Problem:
 Score : 200 points    Problem Statement 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.        Sample Input 1 11      Sample Output 1 9  Among the positive integers less than or equal to 11 , nine integers have an odd number of digits: 1, 2, \ldots, 9 .       Sample Input 2 136      Sample Output 2 46  In addition to 1, 2, \ldots, 9 , another 37 integers also have an odd number of digits: 100, 101, \ldots, 136 .       Sample Input 3 100000      Sample Output 3 90909

Solution (Python):
n = int(input())
count = 0
if n >= 10:
    count += 9
    if n >= 1000:
        count += 900
        if n == 100000:
            count += 90000
        elif n >= 10000:
            count += n - 10000 + 1
    elif n >= 100:
        count += n - 100 + 1
else:
    count += n
print(count)

Solution (Python):

n = int(input())
k = len(str(n))
ans = 0
if k % 2 == 0:
    for i in range(k//2):
        ans += 10**((i*2)+1) - 10**(i*2)
else:
    for i in range(k//2):
        ans += 10**((i*2)+1) - 10**(i*2)
    ans += n - 10**(k-1) + 1
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
    if len(str(i))%2 == 1:
        ans += 1
print (ans)

Solution (Python):
N = int(input())
cnt = 0
for i in range(1, N + 1):
    if i < 10 or 100 <= i < 1000 or 10000 <= i < 100000:
        cnt += 1
print(cnt)

Solution (Python):
N = int(input())
ans = 0

for x in range(1, N+1):
    if len(str(x)) % 2 == 1:
        ans += 1

print(ans)

Solution (Python):
def main():
    N = int(input())
    cnt = 0
    for i in range(1, N+1):
        if len(str(i)) % 2:
            cnt += 1 
    print(cnt)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
cnt = 0
for i in range(1,n+1):
    s = str(i)
    if len(s)%2 == 1:
        cnt += 1
print(cnt)

Solution (Python):
import math

N = int(input())
cnt = 0

for i in range(1, N+1):
    if int(math.log10(i))%2==0:
        cnt += 1

print(cnt)

Solution (Python):
n = int(input())

ans = 0

for i in range(1,n+1):
    if len(str(i)) % 2 == 1:
        ans += 1
        
print(ans)

Solution (Python):
n = input()

intn = int(n)

if len(n) == 1:
    print(intn)
elif len(n) == 2:
    print("9")
elif len(n) == 3:
    print(intn - 100 + 1 + 9)
elif len(n) == 4:
    print(900+9)
elif len(n) == 5:
    print(intn - 10000+ 1 + 900 +9)
else:
    print("90909")

Solution (Python):



n = int(input())

count = 0
for i in range(n):
    j = i + 1
    
    if len(str(j)) % 2 == 1:
        count += 1
        
print(count)

Solution (Python):

import sys
input = sys.stdin.readline









N = int(input())

ans = 0
for i in range(1,N+1):
    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)

Solution (Python):
n = int(input())
cnt = 0
for i in range(1, n+1):
    if len(list(str(i))) % 2 == 1:
        cnt += 1
print(cnt)

Solution (Python):

import math


def main():
    N = int(input())
    digit = math.floor(math.log10(N)) + 1
    if digit == 1:
        print(N)
    elif digit == 2:
        print(9)
    elif digit == 3:
        print(9 + N - 100 + 1)
    elif digit == 4:
        print(909)
    elif digit == 5:
        print(909 + N - 10000 + 1)
    elif digit == 6:
        print(90909)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())

ans = 0
for i in range(n):
    if len(str(i + 1)) % 2 == 1:
        ans += 1
print(ans)

Solution (Python):
N = int(input())
ans =0
for i in range(1,N+1,1):
    if len(str(i))%2 ==1:
        ans+=1
print(ans)

Solution (Python):
n = int(input())

count= 0

for i in range(n):
    if (len(str(int((i+1))))%2)==1:
        count += 1
    else:
        pass

print(count)

Solution (Python):
a = int(input())
total = 0

    
for i in range(1,a+1):
    if i<10 or 99<i<1000 or 9999<i<100000:
        total+=1

print(total)

Solution (Python):
N = int(input())

ans = 0
for i in range(1, N+1, 1):
  if len(str(i)) % 2 == 1:
    ans += 1
    
print(ans)

Solution (Python):
n=int(input())
if n<=9:
  print(n)
elif n<=99:
  print(9)
elif n<=999:
  print(n-90)
elif n<=9999:
  print(909)
elif n==100000:
  print(90909)
else:
  print(n-9090)

Solution (Python):
n = int(input())
i = 1
cnt = 0
while i <= n:
    if len(str(i)) % 2 >= 1:
        cnt += 1
    i += 1
print(cnt)

Solution (Python):
x=int(input())

ans=0
for i in range(1,x+1):
  if len(str(i))%2==1:
    ans+=1
    
print(ans)

Solution (Python):
def ketaodd(n):
    if len(str(n)) % 2 != 0:
        return True
    else:
        return False
m = int(input())
ans = 0
for i in range(1,m+1):
    ans += ketaodd(i)
print(ans)

Solution (Python):
n=int(input(""))
list1=[i for i in range(1,n+1) if(len(str(i))%2!=0)]
print(len(list1))

Solution (Python):
N = int(input())
counter = 0
for i in range(1, N + 1):
    if len(str(i)) % 2:
        counter += 1
print(counter)

Solution (Python):

def odd(x):
    if (x-1)%2 == 0:
        return True
    else:
        return False


N = input()
index, num = len(N), int(N)

ans = 0
for i in range(1, index+1):
    if odd(i):
        if num >= 10**i:
            ans = ans + (10**i - 10**(i-1))
            
        else:
            ans = ans + (num - 10**(i-1) + 1)
            
print(ans)

Solution (Python):
N = int(input())
A = 0
for i in range(1,N+1):
  if len(str(i)) % 2 == 1:
    A += 1
print(A)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
    if len(str(i)) % 2 == 1:
        ans += 1
    else:
        pass
print(ans)

Solution (Python):
n = int(input())
ans = 0

if n >= 10000:
    ans += n - 9999
    ans += 909
    if n == 100000:
        ans -= 1
    print(ans)
    exit()

if n >= 100:
    ans += n - 99
    ans += 9
    if n >= 1000:
        ans -= n-999
    print(ans)
    exit()

if n > 9:
    print(9)
    exit()

print(n)

Solution (Python):
n=int(input())
ans=0
for i in range(1,n+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)

Solution (Python):
ans = 0
for i in range(1, int(input())+1):
    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)

Solution (Python):

n = int(input())
count = 0
for i in range(1,n+1):
    if len(str(i)) % 2 == 1:
        count += 1
print(count)

Solution (Python):
n = int(input())
print(len([i for i in range(1,n+1) if len(str(i))%2==1]))

Solution (Python):
n=int(input())
ans=0
for i in range(1,n+1):
    if len(str(i))%2==1:
        ans+=1
print(ans)

Solution (Python):
a = int(input())
ans= 0
for i in range(1,a+1 ):
	if len(str(i)) % 2 == 1:
		ans += 1
		
print(ans)

Solution (Python):
ans = 0
for i in range(1, int(input()) + 1):
    if i <= 9 or 100 <= i <= 999 or  10000 <= i <= 99999:
        ans += 1
print(ans)

Solution (Python):
N=int(input())
ans=0
for i in range(1,N+1) :
    if len(str(i))%2==0 :
        ans+=0
    else :
        ans+=1
print(ans)

Solution (Python):
import math
n = int(input())
res = 0
for i in range(1,n+1):
    keta = int(math.log10(i))+1
    if(keta % 2 == 1):
        res += 1
print(res)

Solution (Python):
N = int(input())
ans = 0
for i in range(1,N + 1):
    if(len(str(i)) % 2 == 1):
        ans += 1   
print("%d"%(ans))

Solution (Python):
def digit(x):
    cnt = 0
    if x == 0: cnt = 1
    else:
        while x > 0:
            x //= 10
            cnt+=1
    return cnt
n = int(input())
ans = 0
for i in range(1,n+1):
    if digit(i) % 2 == 1: 
        ans+=1
print(ans)

Solution (Python):
N=list(input())
ans=0
for i in range(len(N)):
    if i==len(N)-1:
        if len(N)%2==1:
            s=""
            for num in N:
                s=s+num
            s=int(s)-10**i
            s+=1
            ans+=s
    else:
        if i%2==0:
            ans+=10**(i+1)-10**i
print(ans)

Solution (Python):
N = int(input())
cnt =0
for i in range(1,N+1):
    if 1 <= i and i <= 9:
        cnt += 1
    
    if 100 <= i and i <= 999:
        cnt += 1

    if 10000 <= i and i <= 99999:
        cnt += 1

print(cnt)

Solution (Python):

N = int(input())
count = 0

for i in range(1, N + 1):
    digit = len(str(i))
    if digit % 2 == 1:
        count += 1

print(count)

Solution (Python):
N=int(input())
count=0
for k in range(1,N+1):
  if 1<=k<10 or 100<=k<1000 or 10000<=k<100000:
    count += 1
print(count)

Solution (Python):
N=int(input())
ans=0
for i in range(1,N+1):
    if len(str(i))%2==1:
        ans+=1
print(ans)

Solution (Python):
N=int(input())
count=0
for i in range(1,N+1):
  i=str(i)
  if len(i) % 2 == 1:
    count+=1

print(count)

Solution (Python):
N = input()
if len(N)==1:
    print(int(N))
elif len(N)==2:
    print(9)
elif len(N)==3:
    print(int(N)-99 + 9)
elif len(N)==4:
    print(999-100+1+9)
elif len(N)==5:
    print(int(N)-9999 + 999-100+1+9)
elif len(N)==6:
    print(90909)

Solution (Python):
n = int(input())
cnt = 0
for i in range(1,n + 1):
    if(len(str(i)) % 2 == 1):
        cnt += 1   
print(cnt)

Solution (Python):
def uneven_numbers(n):

    ans = 0

    for i in range(1, n+1):
        if len(str(i)) % 2 != 0:
            ans += 1

    return ans

def main():
    n = int(input())
    print(uneven_numbers(n))

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

if N < 10:
  print(N)
elif N < 100:
  print(9)
elif N < 1000:
  print(N - 90)
elif N < 10000:
  print(909)
elif N < 100000:
  print(N - 9090)
elif N == 100000:
  print(90909)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n = I()
    cnt = 0
    for i in range(1, n+1):
        if len(str(i)) %2 == 1:
            cnt += 1
    print(cnt)

main()

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
    if len(str(i)) % 2 != 0:
        ans+=1
print(ans)

Solution (Python):
n = int(input())
count = 0
for i in range(1,n+1):
    if len(str(i))%2==1:
        count+=1
print(count)

Solution (Python):
N = int(input())

for i in range(N):
    if N <= 9:
        print(N)
        break
    elif N <= 99:
        print("9")
        break
    elif N <= 999:
        print(N-99+9)
        break
    elif N <= 9999:
        print("909")
        break
    elif N <= 99999:
        print(N-9999+909)
        break
    else:
        print("90909")
        break

Solution (Python):
N = int(input())

print(len([0 for n in range(1, N + 1) if len(str(n)) % 2 == 1]))

Solution (Python):
import math

N = int(input())

digits = int(math.log10(N)) + 1

s = 0
for d in range(1, digits, 2):
    s += 9 * int(math.pow(10, d - 1))

if digits % 2 == 1:
    s += N - int(math.pow(10, digits - 1)) + 1

print(s)

Solution (Python):
N = int(input())

if 1<=N<=9:
    print(N)
    exit()

if 10<=N<=99:
    print(9)
    exit()

if 100<=N<=999:
    print(9+N-99)

if 1000<=N<=9999:
    print(909)
    exit()

if 10000<=N<=99999:
    print(909+N-9999)
    exit()

if N ==100000:
    print(90909)
    exit()

Solution (Python):
N=int(input())
if N<10 :
    print(N)
elif 10<=N<100:
    print(9)
elif 100<=N<1000 :
    print(9+N-100+1)
elif 1000<=N<10000 :
    print(909)
elif 10000<=N<100000 :
    print(909+N-10000+1)
elif N==100000 :
    print(90909)

Solution (Python):
n=int(input())
ans=0
for i in range(1,n+1):
    if len(str(i))%2==1:
        ans=ans+1
print(ans)

Solution (Python):
N = int(input())
print(len(list(i for i in range(1, N + 1) if len(str(i)) % 2 == 1)))

Solution (Python):
N = int(input())
count = 0

for i in range(1, N+1):
    if len(str(i)) % 2 == 1:
        count += 1

print(count)

Solution (Python):
import math
import copy
from queue import Queue
import heapq
import numpy as np

MOD = 5000000007

n = int(input())

















sum = 0
for i in range(1,n+1):
    if((1 <= i and i < 10) or (100 <= i and i < 1000) or (10000 <= i and i < 100000)):
        sum += 1

print(sum)

Solution (Python):
n = int(input())
lis = []

for a in range(1, n+1):
  if len(str(a)) % 2 == 1:
    lis.append(a)
    
print(len(lis))

Solution (Python):
N=int(input())
ans=0
i=1
while i<=N:
    if not len(str(i))%2==0:
        ans+=1
    i+=1
print(ans)

Solution (Python):
n = int(input())
l = len(str(n))
res = 0
for i in range(1, l + 1, 2):
    if i == l:
        res += n - 10**(l-1) + 1
    else: res += (10**(i) - 1) - (10**(i-1)) + 1
print(res)

Solution (Python):
n=int(input())
if n<10:
  print(n)
elif n<100:
  print(9)
elif n<1000:
  print(9+n-99)
elif n<10000:
  print(909)
elif n<100000:
  print(909+n-9999)
else:
  print(90909)

Solution (Python):
n = int(input())
cnt = 0
for i in range(1,n+1):
    if(len(str(i))%2==1): cnt+=1
print(cnt)

Solution (Python):
n = int(input())
count=0
for i in range(1,n+1):
  if len(str(i)) % 2 == 1:
    count += 1
print(count)

Solution (Python):
n = int(input())

ans = 0
for i in range(1, n+1):
  keta = 0
  
  while i > 0:
    i = i // 10
    keta += 1
  
  if keta % 2 != 0:
    ans += 1
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(1, N + 1):
    if len(str(i)) % 2:
        ans += 1
print(ans)

Solution (Python):
from sys import *

n = int(stdin.readline())
ans = 0
for i in range(1, n + 1):
	s = str(i)
	if len(s) % 2 is 1:
		ans += 1 
print(ans)

Solution (Python):
n = int(input())
s = len(str(n))
count = 0

if(s % 2 == 1):
  count += (n - 10 ** (s - 1)) + 1

for i in range(1, s):
  if(i % 2 == 1):
    count += (10 ** (i - 1)) * 9
print(count)

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Solution (Python):
s=input()
n=int(s)
s=list(s)
d=len(s)
r=0
for ii in range(d-1):
  if ii%2==0:
    r+=10**(ii+1)-10**ii
if d%2==1:
  r+=n-10**(d-1)+1
print(r)

Solution (Python):
N = int(input())
count = 0

for i in range(1,N+1):
  if len(str(i))%2 == 1:
    count+=1
print(count)

Solution (Python):
n=int(input())
cnt=0
for i in range(1,n+1):
  i=str(i)
  l=len(i)
  if l%2!=0:
    cnt+=1
print(cnt)

Solution (Python):
N = int(input())
cnt = 0
for i in range(1,N+1):
  str_i=str(i)
  if len(str_i)%2 == 1:
    cnt=cnt+1
print(cnt)

Solution (Python):
n=int(input())
count=0

for i in range(1,n+1):
  if len(str(i))%2==1:
    count+=1
    
print(count)

Solution (Python):
n=int(input())
a=0
b=0
for i in range(1,7):
  if 10**(i-1)<=n<10**i:
    a=i
if a==2:
  print(9)
if a==4:
  print(909)
if a==6:
  print(90909)
if a==1:
  print(n)
if a==3:
  print(n-90)
if a==5:
  print(n-9090)

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n + 1):
    if i < 10:
        ans += 1
    elif 100 <= i < 1000:
        ans += 1
    elif 10000 <= i < 100000:
        ans += 1
print(ans)

Solution (Python):
n = int(input())
if(n < 10):
  print(n)
elif(n < 100):
  print(9)
elif(n < 1000):
  print(9 + n - 99)
elif(n < 10000):
  print(909)
elif(n < 100000):
  print(909 + n- 9999)
else:
  print(90909)

Solution (Python):

"""
Created on Fri May 15 00:31:41 2020

@author: Kanaru Sato
"""

n = int(input())

count = 0
for i in range(1,n+1):
    if 1<=i and i<=9:
        count += 1
    elif 100 <= i and i <= 999:
        count += 1
    elif 10000 <= i and i <= 99999:
        count += 1

print(count)

Solution (Python):
N=int(input())
ans=0
for i in range(1,N+1):
    if len(str(i))%2 != 0:
        ans+=1
print(ans)

Solution (Python):

n=input()

k=len(n)
if k==6:
    print(9+900+90000)
elif k==5:
    print(9+900+int(n)-10000+1)
elif k==4:
    print(9+900)
elif k==3:
    print(9+int(n)-100+1)
elif k==2:
    print(9)
else:
    print(int(n))

Solution (Python):
n = int(input())
if n<=9:
    print(n)
elif 10<=n and n<=99 :
    print(9)
elif 100<=n and n<=999:
    print(9+n-100+1)
elif 1000<=n and n<=9999:
    print(909)
elif 10000<=n and n<=99999:
    print(909+n-10000+1)
else :
    print(90909)

Solution (Python):
n = int(input())

def countKeta (num):
    return len(str(num))

count = 0
for i in range(1,n+1):
    if countKeta(i) % 2 == 1:
        count += 1

print(count)

Solution (Python):
n = int(input())

if n < 10:
    print(n)
elif n < 100:
    print(9)
elif n < 1000:
    print(n-90)
elif n < 10000:
    print(909)
elif n < 100000:
    print(n-9090)
elif n < 1000000:
    print(90909)

Solution (Python):
n = int(input())
count = 0
for i in range(1,n+1):
    if len(str(i))%2 != 0:
        count += 1
print(count)

Solution (Python):
N = int(input().rstrip())
result = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        result = result + 1

print(result)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
    if len(list(str(i)))%2 != 0:
        ans += 1
print(ans)

Solution (Python):
n = int(input())
x = [len(str(i+1))%2==1 for i in range(n)]
print(sum(x))

Solution (Python):
n = int(input())
x = [len(str(i+1))%2==1 for i in range(n)]
print(sum(x))

Solution (Python):

import sys

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement


from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter





j=0
k=0
n=3
r=1
a=[0]






"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''


'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  

'''

def factorial(x, mod=10**9+7):
    
    
    
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''











def main():

    steps=0
    state=0
    w=1
    j=0
    k=0
    n=int(input())
    for i in range(1,n+1):
     if len(str(i))%2==1:
        j +=1
    print(j)
    
    
    
    
    




    
        
    
    

    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    
        
        
    
    
        
        
    


    "1行1つの整数を入力を取得し、整数と取得する"
    
    
    "12 21 332 とか入力する時に使う"
    "1行に複数の整数の入力を取得し、整数として扱う"
    
    



    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]
    

    ls = ["a", "b", "c", "d", "e"]


    
    

    
    

    
    
    
    
    
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

Solution (Python):
from math import log10
print(sum(not (int(log10(n)) & 1) for n in range(1, int(input()) + 1)))

Solution (Python):
N = int(input())

keta = len(str(N))
cnt = 0

for i in range(1,keta,2):
    cnt += 9 * (10**(i-1))

if keta % 2 == 1:
    cnt += N - (10**(keta-1)) + 1

print(cnt)

Solution (Python):
N = int(input())
ans = 0

for i in range(1, N + 1):
  if len(str(i)) % 2 == 1:
    ans += 1

print(ans)

Solution (Python):

print(len([str(i) for i in range(1, int(input())+1) if len(str(i)) % 2 == 1]))

Solution (Python):
N = int(input())
cnt = 0
for n in range(1, N+1):
    if len(str(n)) % 2 != 0:
        cnt += 1
print(cnt)

Solution (Python):
n = int(input())

counter = 0
for x in range(1,n+1):
    if(len(str(x)) % 2 != 0):
        counter += 1
print(counter)

Solution (Python):
import sys
import math
import bisect


def main():
    n = int(input())
    ans = 0
    for i in range(1, n + 1):
        if len(str(i)) % 2 == 1:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
ans=0
for i in range(1,n+1):
  if len(str(i))%2!=0:
    ans+=1
print(ans)

Solution (Python):






import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


def lcm(a, b):
    return a * b // gcd (a, b)




ans = 0
for i in range(1,int(input())+1):
  if len(str(i)) %2:
    ans += 1
print(ans)

Solution (Python):
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

def main():
    n=I()
    ans=0
    for i in range(1,n+1):
        if len(str(i))%2==1:
            ans+=1
    print(ans)

if __name__=='__main__':
    main()

Solution (Python):


N = input()
len_n = len(N)
N = int(N)

count = 0

if len_n % 2 == 1:
    current_len_min_val = 10 ** (len_n - 1)
    count += N - current_len_min_val + 1

for i in range(1, len_n, 2):
    count += 10 ** i - 10 ** (i-1)


print(count)

Solution (Python):
n = int(input())
cnt = 0
for i in range(1,n+1):
  a = len(str(i))
  if a % 2 == 1:
    cnt += 1
print(cnt)

Solution (Python):
n=int(input())
c=0
for i in range(1,n+1):
    if len(str(i))%2==1:
        c+=1
print(c)

Solution (Python):
from math import factorial as fact
import math
import sys
import itertools
import numpy as np
from collections import Counter
import datetime
from collections import deque



def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))

def keta(N):
	return len(str(N))


def input_daytime(input_time):
	time,distance=input_time.split()
	t=time.split(":")
	se=str(t[-1]).split(".")
	dt1 = datetime.timedelta(hours=int(t[0]),minutes=int(t[1]),seconds=int(se[0]),milliseconds=int(se[1]))
	return dt1

def combinations(n,r):
	return list(itertools.combinations(range(n),r))



def all_sets(num_list):
	subsets=[]
	for i in range(2,len(num_list) + 1):
		for c in combinations(num_list, i):
			subsets.append(c) 
	return subsets


def ch(x1):
	cf=[]
	for i in range(2,math.sqrt(x1)+1):
		if x1 % i==0:
			cf.append(i)
	return cf

def CountOneRoots(x,y):
	
	return fact(x+y)/fact(x)/fact(y)


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
	
def count_str(m):
	tmp={}
	for i in range(10):
		if i in tmp:
			tmp[i]=1
		else:
			tmp[i]+=1
	return tmp

def is_prime(n):
	if n==1: return True

	for i in range(2,int(math.sqrt(n))+1):
		if n%i==0:
			return False
	return True

n=input1()

count=0
for i in range(1,n+1):
	if len(str(i))%2==1:
		count+=1
print(count)

Solution (Python):
def main():
    n = int(input())
    count = 0
    for i in range(1, n + 1):
        if len(str(i)) % 2 != 0:
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(read())
cnt = 0
for i in range(1, n + 1):
    if len(str(i)) % 2 == 1:
        cnt += 1
print(cnt)

Solution (Python):
n=int(input())
k=0
for i in range(n):
    if len(str(i+1))%2==1:
        k+=1
print(k)

Solution (Python):


n = int(input())
if n <= 9:
    print(n)
elif n <= 99:
    print(9)
elif n <= 999:
    print(9 + n - 99)
elif n <= 9999:
    print(909)
elif n <= 99999:
    print(909 + n - 9999)
else:
    print(90909)

Solution (Python):
N = int(input())
ans = 0
for n in range(1, N+1):
    if len(str(n))%2 == 1:
        ans += 1
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
    if len(str(i))%2 == 1:
        ans += 1
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n+1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Solution (Python):
n=int(input())
ans=0
for i in range(1, n+1):
    if len(str(i)) % 2 != 0:
        ans+=1
print(ans)

Solution (Python):
N=int(input())
ans=0
for i in range(1,(10**5)+1):
    if len(str(i))%2==1: ans+=1
    if i==N: break
print(ans)

Solution (Python):
N=int(input())
if 0<=N<=9:
  print(N)
elif 10<=N<=99:
  print(9)
elif 100<=N<=999:
  print(N-90)
elif 1000<=N<=9999:
  print(909)
elif 10000<=N<=99999:
  print(N-9090)
else:
  print(90909)

Solution (Python):
n = int(input())
count = 0
for i in range(1, n+1):
  if (len(str(i))%2) != 0:
    count += 1
print(count)

Solution (Python):
N=int(input())
C=str(N)
ans=0
j=9
for i in range(len(C)):
    if (i+1)%2!=0:
        if len(C)!=i+1:
            ans+=j
        else:
            if N%10!=0:
                ans+=N-10**i+1
            else:
                ans+=1
    j=9*(10**(i+1))
print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(1,N+1):
    if 1 <= i <=9:
        ans += 1
    elif 100 <= i <=999:
        ans += 1
    elif 10000 <= i <=99999:
        ans += 1
print(ans)

Solution (Python):
def ketasuu(n):
    ans  = 0
    while (n >= 1):
        n = n/10
        ans += 1
    return ans

n = int(input())

k = ketasuu(n)
ans = 0
for i in range(1,k,2):
    ans += 10**i-10**(i-1)
if (k%2 == 1):
    ans += n-10**(k-1)+1

print(ans)

Solution (Python):
A = input()
X = 0
for i in range(1,len(A),2):
    X += int('9'*i) - 10**(i-1)+1
if len(A)%2 == 1 :
    X += int(A) - 10**(len(A)-1)+1
print(X)

Solution (Python):
n = int(input())
res = 0 
for i in range(1, n + 1): 
  string = len(str(i))
  if string % 2 == 1: 
    res +=1 
print(res)

Solution (Python):
cnt = 0
N = int(input())
for i in range(1,N+1):
  if len(str(i)) % 2 == 1:
    cnt += 1

print(cnt)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
    if len(str(i))%2 == 1:
        ans += 1
print(ans)

Solution (Python):
n=int(input())
ans=0
for i in range(1,n+1):
  if len(str(i))%2!=0:
    ans+=1
print(ans)

Solution (Python):
N = int(input())
ans = 0

for i in range(1,N+1):
    if len(str(i)) % 2 != 0:
        ans += 1
print(ans)

Solution (Python):
s = input()

c = 0
for i in range(1, int(s)+1):
    sn = str(i)
    if len(sn) % 2 == 1:
        c += 1

print(c)

Solution (Python):
N = int(input())
ans=0
for i in range(1,N+1):
    if len(str(i))%2!=0:
        ans+=1
print(ans)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce


import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n = I()
l = len(str(n))
ans = 0
if l % 2 == 1:
    ans += n - 10**(l-1) + 1

for i in range(l):
    if i % 2 == 1:
        ans += 9*10**(i-1)

print(ans)