n = int(eval(input()))

odd = [i for i in range(1, n+1) if len(str(i)) % 2 != 0]

print((len(odd)))
n = int(eval(input()))

print((sum([1 for i in range(1, n+1) if len(str(i)) % 2 == 1])))
n = int(eval(input()))
odd = [i for i in range(1, n + 1) if len(str(i)) % 2 != 0]
print((len(odd)))

n = int(eval(input()))
print((sum([1 for i in range(1, n + 1) if len(str(i)) % 2 == 1])))

-odd = [i for i in range(1, n + 1) if len(str(i)) % 2 != 0] -print((len(odd))) +print((sum([1 for i in range(1, n + 1) if len(str(i)) % 2 == 1])))