a =int(eval(input()))

b=0

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

    s=[]

    s=list(str(i))

    if len(s)%2!=0:

        b+=1

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



x = 0

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

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

        x += 1



print(x)
a = int(eval(input()))
b = 0
for i in range(1, a + 1):
    s = []
    s = list(str(i))
    if len(s) % 2 != 0:
        b += 1
print(b)

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

-a = int(eval(input())) -b = 0 -for i in range(1, a + 1): -    s = [] -    s = list(str(i)) -    if len(s) % 2 != 0: -        b += 1 -print(b) +n = int(eval(input())) +x = 0 +for i in range(1, n + 1): +    if len(str(i)) % 2 != 0: +        x += 1 +print(x)