n = int(eval(input()))



ans = 0

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

    if len(str(i)) & 1:

        ans += 1

print(ans)
N = int(eval(input()))



answer = sum(len(str(i))&1 for i in range(1,N+1))

print(answer)
n = int(eval(input()))
ans = 0
for i in range(1, n + 1):
    if len(str(i)) & 1:
        ans += 1
print(ans)

N = int(eval(input()))
answer = sum(len(str(i)) & 1 for i in range(1, N + 1))
print(answer)

-n = int(eval(input())) -ans = 0 -for i in range(1, n + 1): -    if len(str(i)) & 1: -        ans += 1 -print(ans) +N = int(eval(input())) +answer = sum(len(str(i)) & 1 for i in range(1, N + 1)) +print(answer)