N=int(eval(input()))

print((sum(len(str(i))%2==1 for i in range(1,N+1))))
N=int(eval(input()))

print((sum(len(str(i))%2 for i in range(1,N+1))))
N = int(eval(input()))
print((sum(len(str(i)) % 2 == 1 for i in range(1, N + 1))))

N = int(eval(input()))
print((sum(len(str(i)) % 2 for i in range(1, N + 1))))

-print((sum(len(str(i)) % 2 == 1 for i in range(1, N + 1)))) +print((sum(len(str(i)) % 2 for i in range(1, N + 1))))