x=lambda a:+(len(a)<=2*sum(i if i<2 else x(i)for i in a)) while 1:print x(eval("".join(["0,","1,","[","],"]["01{}".find(c)]for c in raw_input()))[0])

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page