N = int(eval(input()))



count = 0

for i in range(N):

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

        count += 1

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



# count = 0

# for i in range(N):

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

#         count += 1

# print(count)



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

N = int(eval(input()))
# count = 0
# for i in range(N):
#     if len(str(i + 1)) % 2 == 1:
#         count += 1
# print(count)
print((sum(1 for i in range(N) if len(str(i + 1)) % 2 == 1)))

-count = 0 -for i in range(N): -    if len(str(i + 1)) % 2 == 1: -        count += 1 -print(count) +# count = 0 +# for i in range(N): +#     if len(str(i + 1)) % 2 == 1: +#         count += 1 +# print(count) +print((sum(1 for i in range(N) if len(str(i + 1)) % 2 == 1)))