s = input() st = set() for i in range(len(s) + 1): for x in range(1 if i == 0 else 0, 10): st.add(int(s[:i] + str(x) + s[i:])) print(len(st))