If Brain in a Jar leaves the battlefield before its first ability resolves, use the number of counters on it at the moment it left to determine what spell you may cast. That number won’t change because you can’t put a new counter on Brain in a Jar.