while~0:s=raw_input();n=0;exec"try:s%((0,)*n)\nexcept:n+=1\n"*17;print n