n=list(input()) l=[] n=n[::-1] for i in range(len(n)): if n[i] in l: pass else: l.append(n[i]) n[i]='' l=l[::-1] k=[] for i in range(len(l)): k.append(ord(l[i])) k.sort() for i in range(len(k)): for j in range(len(k)): #print(l,k) if ord(l[i])==k[j]: l[i]=j+1 break print(*l,sep='')