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