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
import decimal
decimal.getcontext().prec = 100
def sum1(pre,l,r):
    l=max(l,0)
    if(l==0):
        return pre[r]
    return pre[r] - pre[l - 1]

x=int(raw_input())
ans=0
if(x<=9):
    ans=x
elif(x>=10 and x<100):
    ans=9
elif(x>=100 and x<1000):
    ans=9+x-99
elif(x>=1000 and x<10000):
    ans=9+900
elif(x>=10000 and x<100000):
    ans=9+900+x-9999
elif(x>=100000):
    ans=9+900+90000
print ans        


# a,b,c=map(int,raw_input().split())
# if(b+c<=a):
#     print 0
#     exit()
# print c-(a-b)
# # t=1
# # while(t!=0):
# #     t=t-1