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