n = int(eval(input()))

cnt = 0

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

    if len(str(i)) % 2:

        cnt += 1

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

print((sum(len(str(i + 1)) % 2 for i in range(n))))
n = int(eval(input()))
cnt = 0
for i in range(1, n + 1):
    if len(str(i)) % 2:
        cnt += 1
print(cnt)

n = int(eval(input()))
print((sum(len(str(i + 1)) % 2 for i in range(n))))

-cnt = 0 -for i in range(1, n + 1): -    if len(str(i)) % 2: -        cnt += 1 -print(cnt) +print((sum(len(str(i + 1)) % 2 for i in range(n))))