N = int(eval(input()))



count = 0

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

    num_dig = 0

    ii = i

    while ii > 0:

        ii = int(ii / 10)

        num_dig += 1

    if num_dig % 2 != 0:

        count += 1



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



count = 0

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

    if len(str(i)) % 2 != 0:

        count += 1

print(count)
N = int(eval(input()))
count = 0
for i in range(1, N + 1):
    num_dig = 0
    ii = i
    while ii > 0:
        ii = int(ii / 10)
        num_dig += 1
    if num_dig % 2 != 0:
        count += 1
print(count)

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

-    num_dig = 0 -    ii = i -    while ii > 0: -        ii = int(ii / 10) -        num_dig += 1 -    if num_dig % 2 != 0: +    if len(str(i)) % 2 != 0: