n=int(eval(input()))

c=0

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

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

            c+=1

print(c)

n=int(eval(input()))

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

n = int(eval(input()))
print((sum(len(str(i)) % 2 for i in range(1, n + 1))))

-c = 0 -for i in range(1, n + 1): -    if len(str(i)) % 2 != 0: -        c += 1 -print(c) +print((sum(len(str(i)) % 2 for i in range(1, n + 1))))