N = input() S = set() for i in range(len(N)+1): for j in range(10): if i == j == 0: continue s = N[:i] + str(j) + N[i:] S.add(s) print(len(S))