k = int(input())
if k < 10:
    print(k)
    exit()

print((k-8)*10-1)

# def s(n):
#     return sum(list(map(int, str(n))))
#
# l = []
# for i in range(1, 1010):
#     l.append([i, s(i), i/s(i)])
#
# l.sort(key=lambda x:x[2])
# for i in range(len(l)):
#     print(l[i])
#
# max = 0
# for i in range(len(l)):
#     if l[i][0] > max:
#         max = l[i][0]
#         print(l[i][0]+1, end=" ")
# print()
