n = int(eval(input()))





def countKeta(num):

    count = 1

    while num / 10 >= 1:

        count += 1

        num = num // 10

    return count





count = 0



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

    if(countKeta(i) % 2 == 1):

        count += 1



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



if n < 10:

    print(n)

elif n < 100:

    print((9))

elif n < 1000:

    print((n-90))

elif n < 10000:

    print((909))

elif n < 100000:

    print((n-9090))

elif n < 1000000:

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


def countKeta(num):
    count = 1
    while num / 10 >= 1:
        count += 1
        num = num // 10
    return count


count = 0
for i in range(1, n + 1):
    if countKeta(i) % 2 == 1:
        count += 1
print(count)

n = int(eval(input()))
if n < 10:
    print(n)
elif n < 100:
    print((9))
elif n < 1000:
    print((n - 90))
elif n < 10000:
    print((909))
elif n < 100000:
    print((n - 9090))
elif n < 1000000:
    print((90909))

- - -def countKeta(num): -    count = 1 -    while num / 10 >= 1: -        count += 1 -        num = num // 10 -    return count - - -count = 0 -for i in range(1, n + 1): -    if countKeta(i) % 2 == 1: -        count += 1 -print(count) +if n < 10: +    print(n) +elif n < 100: +    print((9)) +elif n < 1000: +    print((n - 90)) +elif n < 10000: +    print((909)) +elif n < 100000: +    print((n - 9090)) +elif n < 1000000: +    print((90909))