Given is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).

Constraints

* 1 \leq N \leq 10^5

Input

Input is given from Standard Input in the following format:


N


Output

Print the number of positive integers less than or equal to N that have an odd number of digits.

Examples

Input

11


Output

9


Input

136


Output

46


Input

100000


Output

90909
N = int(raw_input())

d_num = 0
even = True
ary = []
N_tmp = N

while N_tmp != 0:
    ary.append(N_tmp % 10)
    N_tmp = N_tmp / 10
    even = not even
    d_num = d_num + 1

# print d_num, ary

if d_num == 1:
    print ary[0]
elif d_num == 2:
    print 9
elif d_num == 3:
    print 9 + (N -100) +1
elif d_num == 4:
    print 9 + 900
elif d_num == 5:
    print 9 + 900 + (N -10000) +1
elif d_num == 6:
    print 9 +  900 + 90000
