N = int(eval(input()))



answer = 0

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

    if len(str(x)) & 1:

        answer += 1

        

print(answer)
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



N = int(readline())



answer = sum(len(str(x))&1 for x in range(1,N+1))

print(answer)
N = int(eval(input()))
answer = 0
for x in range(1, N + 1):
    if len(str(x)) & 1:
        answer += 1
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
answer = sum(len(str(x)) & 1 for x in range(1, N + 1))
print(answer)

-N = int(eval(input())) -answer = 0 -for x in range(1, N + 1): -    if len(str(x)) & 1: -        answer += 1 +import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +N = int(readline()) +answer = sum(len(str(x)) & 1 for x in range(1, N + 1))