g={} def f(s): g[0]=1 for i in s:a,b=s.split(i,1);['0'1!=f(a+b.replace(j,'',2),0+int(i+j+j))for j in b] f(input()) print(max(g))