N=int(eval(input()))

ans=0

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

    if len(str(i))%2!=0:

        ans+=1

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

ans=0

l=len(str(N))

for i in range(l+1):

    if i!=l and i%2!=0:

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

    if i==l and i%2!=0:

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

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

N = int(eval(input()))
ans = 0
l = len(str(N))
for i in range(l + 1):
    if i != l and i % 2 != 0:
        ans += (10**i) - (10 ** (i - 1))
    if i == l and i % 2 != 0:
        ans += N - (10 ** (i - 1)) + 1
print(ans)

-for i in range(1, N + 1): -    if len(str(i)) % 2 != 0: -        ans += 1 +l = len(str(N)) +for i in range(l + 1): +    if i != l and i % 2 != 0: +        ans += (10**i) - (10 ** (i - 1)) +    if i == l and i % 2 != 0: +        ans += N - (10 ** (i - 1)) + 1