for s in open(0):i=0;exec("try:s%((0,)*i)\nexcept:i+=1\n"*99);print(i)