# a+aa+aaa+aaaa

# input = 9
# result, num = 0, 0
# for i in range(4):
#     num += input * (10 ** i)
#     result += num

# print(result)

input = "9"
result = int(1*input)+int(2*input)+int(3*input)+int(4*input)
print(result)
