import math

n = int(eval(input()))

cnt = 0

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

    if math.floor(math.log10(i) + 1) % 2:

        cnt += 1

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

cnt = 0

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

    if len(str(i)) % 2:

        cnt += 1

print(cnt)
import math

n = int(eval(input()))
cnt = 0
for i in range(1, n + 1):
    if math.floor(math.log10(i) + 1) % 2:
        cnt += 1
print(cnt)

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

-import math - -    if math.floor(math.log10(i) + 1) % 2: +    if len(str(i)) % 2: