N = int(eval(input()))

count = 0

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

  s = str(i)

  if len(s) % 2 == 1:

    count+=1

    

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

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

N = int(eval(input()))
print((sum([len(str(i + 1)) % 2 for i in range(N)])))

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