N=int(eval(input()))

ans=0

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

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

      ans +=1

ans=int(ans)

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

cnt=0

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

  a = len(str(i))

  if a%2==1:

    cnt +=1

print(cnt)

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

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

-ans = 0 +cnt = 0 -    if len(str(i)) % 2 == 1: -        ans += 1 -ans = int(ans) -print(ans) +    a = len(str(i)) +    if a % 2 == 1: +        cnt += 1 +print(cnt)