import sys

input=sys.stdin.readline

n=int(eval(input()))

ans=0

for _ in range(n):

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

        ans+=1

    n-=1

print(ans)
import sys

input=sys.stdin.buffer.readline

N = int(eval(input()))

S = len(str(N))

cnt=0

for i in range(S,-1,-1):

    if i%2!=0:

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

    else:

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

print(cnt)
import sys

input = sys.stdin.readline
n = int(eval(input()))
ans = 0
for _ in range(n):
    if len(str(n)) % 2 != 0:
        ans += 1
    n -= 1
print(ans)

import sys

input = sys.stdin.buffer.readline
N = int(eval(input()))
S = len(str(N))
cnt = 0
for i in range(S, -1, -1):
    if i % 2 != 0:
        cnt = cnt + N - 10 ** (i - 1) + 1
    else:
        N = 10 ** (i - 1) - 1
print(cnt)

-input = sys.stdin.readline -n = int(eval(input())) -ans = 0 -for _ in range(n): -    if len(str(n)) % 2 != 0: -        ans += 1 -    n -= 1 -print(ans) +input = sys.stdin.buffer.readline +N = int(eval(input())) +S = len(str(N)) +cnt = 0 +for i in range(S, -1, -1): +    if i % 2 != 0: +        cnt = cnt + N - 10 ** (i - 1) + 1 +    else: +        N = 10 ** (i - 1) - 1 +print(cnt)