N = int(eval(input()))



import math

ans = 0

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

    order = int(math.log10(i))+1

    if order%2 == 1:

        ans += 1

    else:

        continue



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

 

ans = 0

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

  x = len(str(i))

  if x%2 == 1:

    ans += 1

    

print(ans)
N = int(eval(input()))
import math

ans = 0
for i in range(1, N + 1, 1):
    order = int(math.log10(i)) + 1
    if order % 2 == 1:
        ans += 1
    else:
        continue
print(ans)

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

-N = int(eval(input())) -import math - +n = int(eval(input())) -for i in range(1, N + 1, 1): -    order = int(math.log10(i)) + 1 -    if order % 2 == 1: +for i in range(1, n + 1): +    x = len(str(i)) +    if x % 2 == 1: -    else: -        continue