From Scorching Madrill, 9 Months ago, written in Text.
Embed
  1. o = c = 0
  2. for e in eval(dir()[0])[0]:
  3.     f = e > '('
  4.     if f * c:
  5.         c -= 2
  6.     else:
  7.         o += f
  8.     c += 1
  9. return o + c/2
  10.  
  11.