l=list(map(int,list(input()))) for mx in range(len(l)): if l[mx]!=max(l): break for mn in reversed(range(len(l))): if l[mn]==max(l):break if mx