N = int(eval(input()))

hako = []

ans = 0

for i in range(N):

    hako.append(N-i)

for k in range(N):

    nakami = hako[k]

    if len(str(nakami))%2 >= 1:

        ans += 1

print(ans)

count = 0

S=int(eval(input()))

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

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

        count +=1

print(count)

N = int(eval(input()))
hako = []
ans = 0
for i in range(N):
    hako.append(N - i)
for k in range(N):
    nakami = hako[k]
    if len(str(nakami)) % 2 >= 1:
        ans += 1
print(ans)

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

-N = int(eval(input())) -hako = [] -ans = 0 -for i in range(N): -    hako.append(N - i) -for k in range(N): -    nakami = hako[k] -    if len(str(nakami)) % 2 >= 1: -        ans += 1 -print(ans) +count = 0 +S = int(eval(input())) +for i in range(1, S + 1): +    if len(str(i)) % 2 == 1: +        count += 1 +print(count)