N = int(eval(input()))

ans = 0

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

    if len(str(i)) % 2 == 1:

        ans += 1

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

print((len(list([x for x in range(1, N + 1) if len(str(x)) % 2 == 1]))))
N = int(eval(input()))
ans = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

N = int(eval(input()))
print((len(list([x for x in range(1, N + 1) if len(str(x)) % 2 == 1]))))

-ans = 0 -for i in range(1, N + 1): -    if len(str(i)) % 2 == 1: -        ans += 1 -print(ans) +print((len(list([x for x in range(1, N + 1) if len(str(x)) % 2 == 1]))))