n = int(eval(input()))

num = 0

for i in range(n):

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

    num += 1

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



cnt = 0

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

    s = len(str(i))

    if s%2 == 1:

        cnt +=1

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

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

-num = 0 -for i in range(n): -    if len(str(i + 1)) % 2 == 1: -        num += 1 -print(num) +cnt = 0 +for i in range(1, n + 1): +    s = len(str(i)) +    if s % 2 == 1: +        cnt += 1 +print(cnt)