N = int(eval(input()))

count = 0

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

  len_i = len(str(i))

  if len_i%2 == 1:

    count += 1

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



if N <= 9:

  print(N)

elif N <= 99:

  print((9))

elif N <= 999:

  print((9+(N-99)))

elif N <= 9999:

  print((909))

elif N <= 99999:

  print((909+(N-9999)))

elif N == 100000:

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

N = int(eval(input()))
if N <= 9:
    print(N)
elif N <= 99:
    print((9))
elif N <= 999:
    print((9 + (N - 99)))
elif N <= 9999:
    print((909))
elif N <= 99999:
    print((909 + (N - 9999)))
elif N == 100000:
    print((90909))

-count = 0 -for i in range(1, N + 1): -    len_i = len(str(i)) -    if len_i % 2 == 1: -        count += 1 -print(count) +if N <= 9: +    print(N) +elif N <= 99: +    print((9)) +elif N <= 999: +    print((9 + (N - 99))) +elif N <= 9999: +    print((909)) +elif N <= 99999: +    print((909 + (N - 9999))) +elif N == 100000: +    print((90909))