S=input() A=[] for i in range(len(S)+1): q,p=S[i:],S[:i] for j in range(10): s=int(p+str(j)+q) A.append(s) print(len(set(A))-1)