n = int(eval(input()))

ans = 0

for i in range(1,10):

  if i <= n:

    ans += 1

  else:

    break

if n > 99:

  for i in range(100,1000):

    if i <= n:

      ans += 1

    else:

      break

if n > 9999:

  for i in range(10000,100000):

    if i <= n:

      ans += 1

    else:

      break

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



if n < 100:

  print((min(n,9)))

elif n < 10000:

  print((min(n-90,909)))

elif n <= 100000:

  print((min(n-9090,90909)))
n = int(eval(input()))
ans = 0
for i in range(1, 10):
    if i <= n:
        ans += 1
    else:
        break
if n > 99:
    for i in range(100, 1000):
        if i <= n:
            ans += 1
        else:
            break
if n > 9999:
    for i in range(10000, 100000):
        if i <= n:
            ans += 1
        else:
            break
print(ans)

n = int(eval(input()))
if n < 100:
    print((min(n, 9)))
elif n < 10000:
    print((min(n - 90, 909)))
elif n <= 100000:
    print((min(n - 9090, 90909)))

-ans = 0 -for i in range(1, 10): -    if i <= n: -        ans += 1 -    else: -        break -if n > 99: -    for i in range(100, 1000): -        if i <= n: -            ans += 1 -        else: -            break -if n > 9999: -    for i in range(10000, 100000): -        if i <= n: -            ans += 1 -        else: -            break -print(ans) +if n < 100: +    print((min(n, 9))) +elif n < 10000: +    print((min(n - 90, 909))) +elif n <= 100000: +    print((min(n - 9090, 90909)))