n_str = eval(input())

n_int = int(n_str)

# 1 ~ 50000

# 桁数が奇数= 1桁, 3桁, 5桁

# 1 ~ 9, 100 ~ 999,10000 ~ 99999の90909個しかないので全探索いけるか?

exs_list = []

for i in range(1, 100000):

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

        exs_list.append(i)



exs = {i: i for i in exs_list}



n_s = []

ans = 0

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

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

        continue

    if i in exs:

        ans += 1



print(ans)











def digit_sum(n):

    # 各桁の和を求める

    # 計算量: O(logN)

    ans = 0

    while n > 0:

        ans += 1

        n //= 10

    return ans



n = int(eval(input()))

cnt = 0



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

    cnt += digit_sum(i) % 2



print(cnt)

n_str = eval(input())
n_int = int(n_str)
# 1 ~ 50000
# 桁数が奇数= 1桁, 3桁, 5桁
# 1 ~ 9, 100 ~ 999,10000 ~ 99999の90909個しかないので全探索いけるか?
exs_list = []
for i in range(1, 100000):
    if len(str(i)) % 2 == 1:
        exs_list.append(i)
exs = {i: i for i in exs_list}
n_s = []
ans = 0
for i in range(1, n_int + 1):
    if len(str(i)) % 2 == 0:
        continue
    if i in exs:
        ans += 1
print(ans)

def digit_sum(n):
    # 各桁の和を求める
    # 計算量: O(logN)
    ans = 0
    while n > 0:
        ans += 1
        n //= 10
    return ans


n = int(eval(input()))
cnt = 0
for i in range(1, n + 1):
    cnt += digit_sum(i) % 2
print(cnt)

-n_str = eval(input()) -n_int = int(n_str) -# 1 ~ 50000 -# 桁数が奇数= 1桁, 3桁, 5桁 -# 1 ~ 9, 100 ~ 999,10000 ~ 99999の90909個しかないので全探索いけるか? -exs_list = [] -for i in range(1, 100000): -    if len(str(i)) % 2 == 1: -        exs_list.append(i) -exs = {i: i for i in exs_list} -n_s = [] -ans = 0 -for i in range(1, n_int + 1): -    if len(str(i)) % 2 == 0: -        continue -    if i in exs: +def digit_sum(n): +    # 各桁の和を求める +    # 計算量: O(logN) +    ans = 0 +    while n > 0: -print(ans) +        n //= 10 +    return ans + + +n = int(eval(input())) +cnt = 0 +for i in range(1, n + 1): +    cnt += digit_sum(i) % 2 +print(cnt)