#!/usr/bin/env python3

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 7)



import math

n = int(readline())

count = 0

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

    if int(math.log10(i)) % 2  == 0:

        count +=1 

print(count)
#!/usr/bin/env python3

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 7)



n = int(readline())

count = 0

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

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

        count += 1

print(count)
#!/usr/bin/env python3
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**7)
import math

n = int(readline())
count = 0
for i in range(1, n + 1):
    if int(math.log10(i)) % 2 == 0:
        count += 1
print(count)

#!/usr/bin/env python3
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**7)
n = int(readline())
count = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        count += 1
print(count)

-import math - -    if int(math.log10(i)) % 2 == 0: +    if len(str(i)) % 2 == 1: