N = int(eval(input()))



keta = len(str(N))

if keta%2 == 0:

    N = 10**(keta-1)-1

total = N

keta = len(str(N))

if keta == 3:

    total -= 90

elif keta == 5:

    total -= 100000-90910



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

total = 0

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

    keta = len(str(i))

    if keta%2 != 0:

        total += 1

print(total)        

    

N = int(eval(input()))
keta = len(str(N))
if keta % 2 == 0:
    N = 10 ** (keta - 1) - 1
total = N
keta = len(str(N))
if keta == 3:
    total -= 90
elif keta == 5:
    total -= 100000 - 90910
print(total)

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

-keta = len(str(N)) -if keta % 2 == 0: -    N = 10 ** (keta - 1) - 1 -total = N -keta = len(str(N)) -if keta == 3: -    total -= 90 -elif keta == 5: -    total -= 100000 - 90910 +total = 0 +for i in range(1, N + 1): +    keta = len(str(i)) +    if keta % 2 != 0: +        total += 1