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
f = lambda : raw_input().rstrip()
f1 = lambda : f().split()
f2 = lambda t : map(t, f1())

def main1():
    A, B, C = f2(int)
    print 0 if B + C <= A else (B + C) - A

def main2():
    n = int(f())
    p = 0
    ans = 0
    while 10**p <= n:
        if 10**(p+1) > n:
            ans = ans + n - 10**p + 1
        else:
            ans = ans + 10**(p+1) - 10**p 
        p = p + 2
    print ans
    
def main3():
    n = int(f())
    a = f2(int)
    m = 0
    for i in xrange(1,n):
        if a[i] < a[i-1]:
            m = m + 1#(a[i-1] - a[i])
  
    print "Yes" if m < 2 else "No"

def main4():
    s = f()
    n = len(s)
    ans = [0]*n
    m = 1
    i = 1
    st = 0
    s = s + ("L" if s[-1]=="R" else "R")
    while i <= n:
        if s[i] != s[i-1]:
            #print i, st,
            j = st if s[i-1]=="L" else i
            #print j
            if m&1:
                ans[j-1] = ans[j-1] + m/2 + (1 if s[i-1] == "R" else 0) 
                ans[j] = ans[j] + m/2 + (1 if s[i-1] == "L" else 0)
            else:
                ans[j-1] =  ans[j-1] + m/2
                ans[j] = ans[j] + m/2
            m = 0
            st = i
        #print ans
        i = i + 1
        m = m + 1
    print " ".join(map(str,ans)) 
         
if __name__=="__main__":
    main2()