N = int(eval(input()))

cnt = 0



while N > 0:

  s = str(N)

  length = len(s)

  if length % 2 == 0:

    N -= 1

  else:

    cnt += 1

    N -= 1

    

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

cnt = 0



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

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

    cnt += 1



print(cnt)
N = int(eval(input()))
cnt = 0
while N > 0:
    s = str(N)
    length = len(s)
    if length % 2 == 0:
        N -= 1
    else:
        cnt += 1
        N -= 1
print(cnt)

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

-while N > 0: -    s = str(N) -    length = len(s) -    if length % 2 == 0: -        N -= 1 -    else: +for i in range(1, N + 1): +    if len(str(i)) % 2 == 1: -        N -= 1