N = int(eval(input()))

s = 0

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

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

        s = s+1

print (s)
N = int(eval(input()))

s = len(str(N))

t = 0

for i in range(0,s//2):

    t = t+9*10**(i*2)

if s%2 == 1:

    t = t+N-10**(s-1)+1

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

N = int(eval(input()))
s = len(str(N))
t = 0
for i in range(0, s // 2):
    t = t + 9 * 10 ** (i * 2)
if s % 2 == 1:
    t = t + N - 10 ** (s - 1) + 1
print(t)

-s = 0 -for i in range(1, N + 1): -    if len(str(i)) % 2 == 1: -        s = s + 1 -print(s) +s = len(str(N)) +t = 0 +for i in range(0, s // 2): +    t = t + 9 * 10 ** (i * 2) +if s % 2 == 1: +    t = t + N - 10 ** (s - 1) + 1 +print(t)