n = int(eval(input()))



ans = 0



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

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

		ans += 1



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

keta = len(n)

n = int(n)



ans = 0

for i in range(1,keta,2):

	ans += 9 * (10 ** (i-1))



if keta % 2 == 0:

	print(ans)

else:

	ans += n - 10**(keta-1) + 1

	print(ans)

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

n = eval(input())
keta = len(n)
n = int(n)
ans = 0
for i in range(1, keta, 2):
    ans += 9 * (10 ** (i - 1))
if keta % 2 == 0:
    print(ans)
else:
    ans += n - 10 ** (keta - 1) + 1
    print(ans)

-n = int(eval(input())) +n = eval(input()) +keta = len(n) +n = int(n) -for i in range(1, n + 1): -    if int(len(str(i))) % 2 == 1: -        ans += 1 -print(ans) +for i in range(1, keta, 2): +    ans += 9 * (10 ** (i - 1)) +if keta % 2 == 0: +    print(ans) +else: +    ans += n - 10 ** (keta - 1) + 1 +    print(ans)