n = int(eval(input()))

res = 0



for i in range(1, n + 1):

  l = len(str(i))

  res += l & 1



print(res)
n = int(eval(input()))

print((sum([len(str(x)) & 1 for x in range(1, n+1)])))
n = int(eval(input()))
res = 0
for i in range(1, n + 1):
    l = len(str(i))
    res += l & 1
print(res)

n = int(eval(input()))
print((sum([len(str(x)) & 1 for x in range(1, n + 1)])))

-res = 0 -for i in range(1, n + 1): -    l = len(str(i)) -    res += l & 1 -print(res) +print((sum([len(str(x)) & 1 for x in range(1, n + 1)])))