n = int(eval(input()))

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

gen = (x for x in range(1,n+1) if len(str(x))%2 == 1)

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

n = int(eval(input()))
gen = (x for x in range(1, n + 1) if len(str(x)) % 2 == 1)
print((len(list(gen))))

-print((len(list([x for x in range(1, n + 1) if len(str(x)) % 2 == 1])))) +gen = (x for x in range(1, n + 1) if len(str(x)) % 2 == 1) +print((len(list(gen))))