N = int(eval(input()))



c = 0

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

    if len(str(i))%2 == 1:

        c += 1

print(c)

        
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()))
c = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        c += 1
print(c)

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())) +n = int(eval(input())) -for i in range(1, N + 1): -    if len(str(i)) % 2 == 1: +for i in range(1, n + 1): +    if len(str(i)) % 2 != 0: