__author__ = 'Zlobober'
n = int(raw_input())
ans = 0
for l in range(1, 11):
if (l == len(str(n))):
ans += (n - 10**(l-1) + 1) * l
elif (l < len(str(n))):
ans += (9 * 10**(l - 1)) * l
else:
break
print ans
X19hdXRob3JfXyA9ICdabG9ib2JlcicKCm4gPSBpbnQocmF3X2lucHV0KCkpCmFucyA9IDAKZm9yIGwgaW4gcmFuZ2UoMSwgMTEpOgogICAgaWYgKGwgPT0gbGVuKHN0cihuKSkpOgogICAgICAgIGFucyArPSAobiAtIDEwKioobC0xKSArIDEpICogbAogICAgZWxpZiAobCA8IGxlbihzdHIobikpKToKICAgICAgICBhbnMgKz0gKDkgKiAxMCoqKGwgLSAxKSkgKiBsCiAgICBlbHNlOgogICAgICAgIGJyZWFrCgpwcmludCBhbnM=