import math



# inputList=[]

# for i in range(6):

#     inputNum = input()

#     inputList.append(inputNum)

inputa = input().split()

# inputb = input().split()



# inputa = [int(n) for n in inputa]

# inputa.sort()



# inputa = list(inputa[0])



a = int(inputa[0])

# b = int(inputa[1])

# c = int(inputa[2])



# x = int(inputb[0])

# y = int(inputb[1])



cnt = 0

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

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

       cnt += 1



print(cnt)



import math

import copy

from copy import deepcopy

import sys

import fractions

# import numpy as np

from functools import reduce

# import statistics

import decimal

import heapq

import collections

import itertools

from operator import mul



sys.setrecursionlimit(100001)





# input = sys.stdin.readline

# sys.setrecursionlimit(10**6)



# ===FUNCTION===



def getInputInt():

    inputNum = int(eval(input()))

    return inputNum





def getInputListInt():

    outputData = []

    inputData = input().split()

    outputData = [int(n) for n in inputData]



    return outputData





def getSomeInputInt(n):

    outputDataList = []

    for i in range(n):

        inputData = int(eval(input()))

        outputDataList.append(inputData)



    return outputDataList





def getSomeInputListInt(n):

    inputDataList = []

    outputDataList = []

    for i in range(n):

        inputData = input().split()

        inputDataList = [int(n) for n in inputData]

        outputDataList.append(inputDataList)



    return outputDataList





# ===CODE===



n = int(eval(input()))



ans = 0

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

    s = str(i)

    if len(s) % 2 == 1:

        ans += 1



print(ans)

import math

# inputList=[]
# for i in range(6):
#     inputNum = input()
#     inputList.append(inputNum)
inputa = input().split()
# inputb = input().split()
# inputa = [int(n) for n in inputa]
# inputa.sort()
# inputa = list(inputa[0])
a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])
# x = int(inputb[0])
# y = int(inputb[1])
cnt = 0
for i in range(1, a + 1):
    if len(str(i)) % 2 == 1:
        cnt += 1
print(cnt)

import math
import copy
from copy import deepcopy
import sys
import fractions

# import numpy as np
from functools import reduce

# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)
# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)
# ===FUNCTION===
def getInputInt():
    inputNum = int(eval(input()))
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]
    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(eval(input()))
        outputDataList.append(inputData)
    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)
    return outputDataList


# ===CODE===
n = int(eval(input()))
ans = 0
for i in range(1, n + 1, 1):
    s = str(i)
    if len(s) % 2 == 1:
        ans += 1
print(ans)

+import copy +from copy import deepcopy +import sys +import fractions -# inputList=[] -# for i in range(6): -#     inputNum = input() -#     inputList.append(inputNum) -inputa = input().split() -# inputb = input().split() -# inputa = [int(n) for n in inputa] -# inputa.sort() -# inputa = list(inputa[0]) -a = int(inputa[0]) -# b = int(inputa[1]) -# c = int(inputa[2]) -# x = int(inputb[0]) -# y = int(inputb[1]) -cnt = 0 -for i in range(1, a + 1): -    if len(str(i)) % 2 == 1: -        cnt += 1 -print(cnt) +# import numpy as np +from functools import reduce + +# import statistics +import decimal +import heapq +import collections +import itertools +from operator import mul + +sys.setrecursionlimit(100001) +# input = sys.stdin.readline +# sys.setrecursionlimit(10**6) +# ===FUNCTION=== +def getInputInt(): +    inputNum = int(eval(input())) +    return inputNum + + +def getInputListInt(): +    outputData = [] +    inputData = input().split() +    outputData = [int(n) for n in inputData] +    return outputData + + +def getSomeInputInt(n): +    outputDataList = [] +    for i in range(n): +        inputData = int(eval(input())) +        outputDataList.append(inputData) +    return outputDataList + + +def getSomeInputListInt(n): +    inputDataList = [] +    outputDataList = [] +    for i in range(n): +        inputData = input().split() +        inputDataList = [int(n) for n in inputData] +        outputDataList.append(inputDataList) +    return outputDataList + + +# ===CODE=== +n = int(eval(input())) +ans = 0 +for i in range(1, n + 1, 1): +    s = str(i) +    if len(s) % 2 == 1: +        ans += 1 +print(ans)