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())
cnt = 0
for i in range(1,n+1):
  if len(str(i)) % 2 == 1:
    cnt += 1
print(cnt)

Solution (Python):
import sys
"""
for line in sys.stdin:
    A, B, C = map(int, line.split())
"""
for line in sys.stdin:
    N = int(line)

cnt = 0
for n in range(1,N+1):
  n = str(n)
  if len(n) % 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!=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())
cnt=0
for i in range(1,n+1):
  for j in range(6):
    if 10**j<=i<10**(j+1):
      J=j
      break
  if J%2==0:
    cnt+=1
print(cnt)

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())
cnt = 0

while N > 0:
  s = str(N)
  length = len(s)
  if length % 2 == 0:
    N -= 1
  else:
    cnt += 1
    N -= 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())
count=0
for n in range(1,N+1):
    if 0<n<10:
        count+=1
        continue
    elif 99<n<1000:
        count+=1
        continue
    elif 9999<n<100000:
        count+=1
        continue
    else:
        pass
print(count)

Solution (Python):
n = int(input())
def check_10(num, count):
    if num < 10:
        return count
    num /= 10
    count += 1
    return check_10(num, count)
c = 0
counter = check_10(n, c)
result = 0
if counter%2 == 0:
    for i in range(int(counter//2)):
        result += 10**(2*i+1) - 10**(2*i)
    result += n - 10**counter + 1
elif counter >= 2:
    for i in range(int(counter//2)+1):
        result += 10**(2*i+1) - 10**(2*i)
elif counter == 1:
    result += 9
else:
    result += n
print(result)

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

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

Solution (Python):
A=input()
n=len(A)
ans=0
if n == 1:
  ans=int(A)
elif n == 2:
  ans=9
elif n == 3:
  ans=int(A)-90
elif n == 4:
  ans=909
elif n == 5:
  ans=int(A)-9090
else:
  ans = 90909
print(ans)

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):
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



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

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

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


a1 = 10 - 1 

a2 = 100 - 10 

a3 = 1000 - 100 

a4 = 10000 - 1000 


a5 = 100000 - 10000 

if N // 10**5 > 0:
  print(a1+a3+a5)
elif N // 10**4 > 0:
  print(N - 10**4+1+a1 + a3)
elif N // 10**3 > 0:
  print(a3+a1)
elif N // 10**2 > 0:
  print(N - 10**2+ 1  + a1)
elif N // 10 > 0:
  print(a1)
else:
  print(N)

Solution (Python):
N = int(input())
f = len(str(N))
if f%2 == 0:
  print((100**(f//2)-1)//11)
else:
  print((100**((f-1)//2)-1)//11 + N - 10**(f-1) + 1)

Solution (Python):

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

Solution (Python):
print(sum(len(str(i+1))%2for i in range(int(input()))))

Solution (Python):
import math

s = input().split()
n=int(s[0])
x = int(math.log(n, 10))
count=0
for i in range(x):
        if i%2==0:
                count=count+9*10**i
if x % 2 == 0:
                count = count+n-10**x+1

print(count)

Solution (Python):
n = input()

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

print(c)

Solution (Python):
N = int(input())
uneven = [9, 0, 900, 0, 90000]
digits = len(str(N))

if digits == 1:
    print(N)
elif (digits % 2) == 0:
    print(sum(uneven[0:digits]))
else:
    print(N - 10**(digits-1) + 1 + sum(uneven[0:digits-1]))

Solution (Python):
n=input()
L=len(n)
N=int(n)
if L==1:
    print(N)
elif L==2:
    print(9)
elif L==3:
    print(9+N-100+1)
elif L==4:
    print(9+900)
elif L==5:
    print(9+900+N-10000+1)
else:
    print(9+900+90000)

Solution (Python):
import math
n=int(input())
m=int(math.log10(n)+1)
ans=0
def count(x):
  global ans
  if x>0:
    ans+=10**(x)-10**(x-1)
    count(x-2)
  else:
    return ans
if m%2==0:
  count(m-1)
else:
  count(m-2)
  ans+=n-10**(m-1)+1
print(ans)

Solution (Python):

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

Solution (Python):
def is_odd_digit(x):
	i = 0
	while x != 0:
		x //= 10
		i += 1
	return i % 2 != 0

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

main()

Solution (Python):
a = [int(input()) for i in range(1)][0]
r = 0

for i in reversed(range(0, a)):
    if (len(str(a)) % 2) != 0:
        r = r + 1
    a = a - 1
print(r)

Solution (Python):

import math





class CalcVal():
    def set_num(self, num):
        self._num = num
        self._calc_ord()
        
    def get_sum_pow(self):
        max_rng = math.ceil(self._ord/2.)
        sum_data = 0
        for i in range(max_rng):
            sum_data += 9*10**(i*2)
        return sum_data
    
    def get_remain_cal(self):
        self._ord = math.floor(math.log10(self._num))
        if self._ord == 0:
            
            return self._num
        else:
            return self._num - 10**self._ord + 1
        
    def do(self):
        sum_data = self.get_sum_pow()
        if self._ord%2 == 0:
            sum_data += self.get_remain_cal()
        return sum_data
        
    
    def _calc_ord(self):
        self._ord = math.floor(math.log10(self._num))


def main_func():
    cv = CalcVal()
    cv.set_num(int(input()))
    print(cv.do())
        

main_func()

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())
if n<10:
  print(n)
  exit()
if 10<=n<100:
  print(9)
  exit()
if 100<=n<1000:
  print(9+n-99)
if 1000<=n<10000:
  print(909)
if 10000<=n<100000:
  print(n-9999+909)
if n==100000:
  print(90909)

Solution (Python):
N = int(input())
count = 0
keta_list = [9, 0, 900, 0, 90000, 0]
genkai_list = [9, 0, 999, 0, 99999, 0]
keta = len(str(N))
for target_list in range(keta):
    if N > genkai_list[target_list]:
        count = count + keta_list[target_list]
    else: 
        count = count + N - 10 ** (target_list)+1
print(count)

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

print(len([x for x in list(range(1,n+1)) if len(str(x)) & 1 == 1]))

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

print(len([x for x in list(range(1,n+1)) if len(str(x)) & 1 == 1]))

Solution (Python):
N = int(input())
count=0
for i in [0,2,4]:
  if N < 10**i:
    break
  for j in range(10**i, min(10**(i+1), N+1)):
    count+=1
print(count)

Solution (Python):
N = int(input())
for i in range(6):
  if 10**i<=N and N<10**(i+1):
    n = i+1 
    
ans = 0
if n%2==0:
  for i in range(1,n):
    if i%2!=0:
      ans += 10**i-10**(i-1)
else:
  for i in range(1,n+1):
    if i%2!=0 and i!=n:
      ans += 10**i-10**(i-1)
    elif i==n:
      ans += N - 10**(n-1)+1
print(ans)

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

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

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):
num = int(input())

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

Solution (Python):
n = int(input())
n_digit = len(str(n))
ans = 0
for digit in range(1, n_digit, 2):
    ans += 10**digit - 10**(digit-1)
if n_digit % 2:
    ans += n - 10**(n_digit-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):

import sys

def getNumOfDigits(num: int):
    count = 1
    while True:
        count += 1
        num /= 10
        if num < 10:
            break
    return count

def solve(N: int):
    num = getNumOfDigits(N)
    if num in {1,2}:
        print(min(N,9))
    elif num in {3,4}:
        print(9 + min(N -100 + 1, 900))
    elif num in {5,6}:
        print(909 + min(N - 10000 + 1, 90000))
    else :
        print('none')
    
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

N = int(sys.stdin.read().strip())
total = 0
for v in range(6):
  if v % 2 != 0:
    continue
  low = 10 ** v
  high = 10 ** (v+1)
  if N < low:
    break
  if N >= high:
    total += high - low
  else:
    total += N - low + 1
    break
print(total)

Solution (Python):
N=int(input())
S=0
for x in range(1,N+1):
    i=0
    j=0
    XX=x
    while i==0:
        XX=XX//10
        if XX==0:
            i=1
        j=j+1
    if j%2==1:
        S=S+1
print(S)

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

i = 0
answer = 0
while n >= 10 ** (2*i + 1):
  answer += 10 ** (2*i + 1) - 10 ** (2*i)
  i += 1
answer += max(0, n - 10 ** (2*i) + 1)

print(answer)

Solution (Python):
N = input()
l = (len(N) + 1) // 2
isodd = len(N) % 2
cnt = 0
for ii in range(1, l + 1):
    k = ii * 2 - 1
    if ii == l and isodd:
        cnt += int(N) - 10 ** (k - 1) + 1
    else:
        cnt += 10 ** k - 10 ** (k - 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):
a = int(input())
l = len(str(a))
s = l//2
t = 0
x = 0
if l%2 == 1:
    for i in range(s):
        t += 9*10**(2*i+1)
    x =a-t
else:
    for i in range(s-1):
        t += 9*10**(2*i+1)
    x = 10**(l-1)-1-t
print(x)

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

i=1
cnt = 0 
while(i<=n):
	if i < 10 or (i >= 100 and i < 1000) or (i>=10000 and i<100000) :
		cnt+=1
		i+=1
	elif n == 100000:
		cnt  = 90909
		break
	elif len(str(i)) > 1:
		if i < 100:
			i = 100

		elif i >999 and i< 10000:
			i = 10000
	
print(cnt)

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

i=1
cnt = 0 
while(i<=n):
	if i < 10 or (i >= 100 and i < 1000) or (i>=10000 and i<100000) :
		cnt+=1
		i+=1
	elif n == 100000:
		cnt  = 90909
		break
	elif len(str(i)) > 1:
		if i < 100:
			i = 100

		elif i >999 and i< 10000:
			i = 10000
	
print(cnt)

Solution (Python):


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

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

for i in range(1, N+1):
	num = i
	digit = 0
	while num > 0:
		num //= 10
		digit += 1

	if digit % 2 == 1:
		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())

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

print(counter)

Solution (Python):
def B_UnevenNumbers():
    N = int(input())
    num = 0
    for x in range(1,N+1):
        if len(str(x)) % 2:
            num += 1
    print(num)
    
if __name__ == "__main__":
    B_UnevenNumbers()

Solution (Python):

import bisect
import collections
import itertools


def getint(): return int(input())
def getints(): return list(map(int, input().split()))
def getint2d(rows): return [getints() for _ in range(rows)]
def getgrid(rows): return [input() for _ in range(rows)]
def array1d(n, value): return [value for _ in range(n)]
def array2d(n, m, value): return [array1d(m, value) for _ in range(n)]

n=getint()

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

print(res)

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

Solution (Python):
n = int(input())
digit = len(str(n))

ans = 0

if digit == 1:
    ans = n
elif digit == 2:
    ans = 9
elif digit == 3:
    ans = 9 + (n - 99)
elif digit == 4:
    ans = 9 + 900
elif digit == 5:
    ans = 9 + 900 + (n - 9999)
elif digit == 6:
    ans = 9 + 900 + 90000
    
print(ans)

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

result = []
for i in range(1,n+1):
    if len(str(i)) % 2 != 0:
        result.append(i)
        
print(len(result))

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

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()

zero = "0"
nine = "9"
zeronine = ""

for index in range(len(n)-1):
  if index%2==1:
    zeronine += zero
  else:
    zeronine += nine

if len(n)%2==0:
  print(int(zeronine))
else:
  if len(n)==1:
    print(int(n))
  else:
    print(int(n)-int(zeronine))

Solution (Python):
n=int(input())
ans=0
for i in range(1,n+1):
    k=1
    while i>=10**k:
        k+=1
    if k%2==1:
        ans+=1
print(ans)

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

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

print(res)

Solution (Python):
import sys
input = sys.stdin.readline

N, = map(int, input().split())

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

Solution (Python):
n = input()
digit_n = len(str(n))
n = int(n)
ans = 0

if digit_n % 2 == 0:
    for i in range(digit_n // 2):
        ans += 9 * 10 ** (i * 2)

else:
    if digit_n != 1:
        for i in range((digit_n - 1) // 2):
            ans += 9 * 10 ** (i * 2)
        hasuu = n - 10 ** ((i+1)*2)
        ans += hasuu + 1
    
    else:
        ans = n

    
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 = input('')

n = int(n)

result = []
for i in range(1,n+1):
    if len(str(i)) % 2 !=0:
        result.append(i)
print(len(result))

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

result = list(filter(lambda i: len(str(i)) % 2 != 0, range(1,N+1)))
print(len(result))

Solution (Python):
n=str(input())
if len(n)%2==0:
    if len(n)==2:
        print(9)
    elif len(n)==4:
        print(909)
    else:
        print(90909)
else:
    if len(n)==1:
        print(int(n))
    elif len(n)==3:
        print(int(n)-90)
    else:
        print(int(n)-9090)

Solution (Python):


n= int(input())

sum = 0

i = 0
while True:
    min = 10 ** i
    max = 10 ** (i+1) - 1

    if n < min:
        break
    elif n < max:
        max = n

    sum += max - min + 1
    i += 2

print(sum)

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

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

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

for i in range(N):
    s = str(i+1)
    if len(s) == 1 or len(s) == 3 or len(s) == 5:
        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):
import math

n = int(input())

ans = 0
for i in range(1, n + 1):
    if math.floor(math.log10(i)) % 2 == 1:
        continue
    else:
        ans += 1

print(ans)

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

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

print(ans)

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

ans = 0
for i in range(1,N+1):
  if (10**digit)-1<i:
    digit += 1
  if digit%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):
import math





inputa = input().split()







a = int(inputa[0])






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

print(cnt)

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

Solution (Python):
import numpy as np

N = int(input())
max_power = int(np.log10(N))
counter = 0
for power in range(1, max_power+1, 2):
    counter += 10 ** power - 10 ** (power - 1)
if max_power % 2 == 0:
    counter += N - 10 ** max_power + 1
else:
    pass
print(counter)

Solution (Python):
N = int(input())
maxn = len(str(N))
n=maxn-1
sum = 0
for i in range(0,n,2):
    sum+=9*(10**i)
if maxn % 2 != 0:
    sum+=N-(10**(maxn-1)-1)
print(sum)

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

if n < 100:
  print(min(n,9))
elif n < 10000:
  print(min(n-90,909))
elif n <= 100000:
  print(min(n-9090,90909))

Solution (Python):
import math

n = int(input())
counter = 0
for i in range(1, n+1):
  if int(math.log10(i) % 2) == 0:
    counter += 1
  else: continue
print(counter)

Solution (Python):
s = input()
n = int(s)
l = len(s)

if l==1:
    print(n)
elif l==2:
    print(9)
elif l==3:
    print(n-90)
elif l==4:
    print(909)
elif l==5:
    print(n-9090)
else:
    print(90909)

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

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

l = [i for i in range(1, n+1) if len(str(i)) % 2 == 1]

print(len(l))

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

Solution (Python):
a=input()

b=int(a)
l=len(a)

if l==1:
    s=b

if l==2:
    s=9

if l==3:
    s=9+b-99
if l==4:
    s=909
if l==5:
    s=909+b-9999
if l==6:
    s=90909

print(s)

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

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

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

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

Solution (Python):


def solve():
    N = int(input())
    

    """
    100 ~ 999 = (1000 - 100)
    """

    ans = 0
    if N >= 10**5:  
        ans += (10**5 - 10**4)
        ans += (10**3 - 10**2)
        ans += (10**1 - 1)
    elif N >= 10**4:  
        ans += (N - 10**4 + 1)
        ans += (10**3 - 10**2)
        ans += (10**1 - 1)
    elif N >= 10**3:  
        ans += (10**3 - 10**2)
        ans += (10**1 - 1)
    elif N >= 10**2:  
        ans += (N - 10**2 + 1)
        ans += (10**1 - 1)
    elif N >= 10**1:  
        ans += (10**1 - 1)
    elif N >= 1:
        ans += N
    
    print(ans)

if __name__ == "__main__":
    solve()

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):
x=int(input())
ans=0
for i in range(1,x+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())
if(N<10):
    print(N)
elif(N<1000):
    print(max(0, N-99)+9)
elif(N<100000):
    print(max(0, N-9999)+909)
else:
    print(90909)

Solution (Python):
n = int(input())
c = len(list(str(n)))
if c % 2 == 1:
    
    if c == 1:
        print(n)
    elif c == 3:
        print(9 + (n - 100 + 1))
    else:
        print(9 + 900 + (n - 10000 + 1))
else:
    
    if c == 2:
        print(9)
    elif c == 4:
        print(9 + 900)
    else:
        print(9 + 900 + 90000)

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

if(N == 100000):
    ans = 90909
elif(10000 <= N < 100000):
    ans = 909 + N - 9999
elif(1000  <= N < 10000):
    ans = 909
elif(100   <= N < 1000):
    ans = 9 + N -99
elif(10    <= N < 100):
    ans = 9
elif(1     <= N < 10):
    ans = N

print(ans)

Solution (Python):
a = int(input())
s = str(a)
c = 0
for i in range(len(s)-1):
    
    if i%2 == 0:
        c += 10**(i+1) - 10**i 

if len(s) %2 == 1 and len(s)> 1:
    c += int(s[1:])+1 + (int(s[0])-1)*(10**(len(s)-1))
elif len(s)==1:
    c +=a

print(c)

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

print(num)

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 judge_digit(arg_num):
    result = len(str(arg_num))
    return result

N = int(input())
cnt =0

for i in range(1,N+1) :
    aaa = judge_digit(i)
    if aaa %2 ==0 :
        cnt +=0
    else:
        cnt+=1
print(cnt)

Solution (Python):
N = input()

int_n = int(N)
count=0

while(int_n > 0):
    
    letterLen = len(str(int_n))
 
    if (letterLen % 2 == 1):
        count +=1 
        
    int_n -=1

print(count)

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

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

print(res)

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

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

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

if N < 10:
    print(len(range(1, N+1)))
elif N < 100:
    print("9")
elif N < 1000:
    print(str(9 + len(range(100, N+1))))
elif N < 10000:
    print(str(9+900))
elif N < 100000:
    print(str(9+900+len(range(10000, N+1))))
else:
    print("90909")

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

if __name__ == '__main__':
    main()

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())
print(sum([1 for i in range(1, n+1) if len(str(i)) % 2 == 1]))

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

Solution (Python):


import math

n = int(input())
o = math.floor(math.log(n, 10))
ans = 0

for i in range(o):
    if i % 2 == 0:
        ans += 10 ** (i + 1) - 10 ** i
    else:
        continue

if o % 2 == 0:
    ans += n - (10 ** o) + 1


print(ans)

Solution (Python):

"""
Created on Mon Aug 12 18:42:33 2019
@author: doppe
"""

N = int(input())

list = [9,0,900,0,90000,0,9000000]
count = 0
i = 0
param = 1
while True:
    if N  < param * 10:
        if i % 2 == 0:
            count += N - param + 1
        break
    else:
        count += list[i]
    i += 1
    param *= 10
print(count)

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

Solution (Python):
N = int(input())
keta = len(str(N))
cnt = 0

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

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

print(cnt)

Solution (Python):
import sys
from operator import itemgetter
import math
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()
keta = len(str(n))
rs = 0
if keta % 2 == 1:
    rs += n - (10 ** (keta - 1)) + 1
li = [0, 9, 0, 900, 0, 90000]
keta -= 1
while keta > 0:
    rs += li[keta]
    keta -= 1
print(rs)

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

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

print(nbs)

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

print(ans)

Solution (Python):
import io
import sys

MOD = 10 ** 9 + 7


def IN_S():
  return input()


def IN_I():
  return int(input())


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


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
136
'''


def MAIN():
  
  A()


def A():
  n = IN_I()

  t = 0
  if n > 9:
    t += 9

  if n > 999:
    t += 900

  if n > 99999:
    t += 90000

  if n <= 9:
    t += n
  elif 99 < n <= 999:
    t += n - 99
  elif 9999 < n <= 99999:
    t += n - 9999

  print(t)
  return None


def B():
  return None


def C():
  return None


MAIN()

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 math import log10, floor, ceil
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):
    m = str(i)
    if len(m)%2==1:
        cnt += 1
print(cnt)

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

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):
"""
AtCoder
    :author: vierbein
"""
from __future__ import absolute_import, division, print_function



import sys


def pp(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)


def get_digits(n):
    res = 0
    while n > 0:
        res += 1
        n //= 10
    
    return res


N = int(input())
digits = get_digits(N)

if digits == 2:
    res = 9
elif digits == 4:
    res = 909
elif digits == 6:
    res = 90909
elif digits == 1:
    res = N
elif digits == 3:
    res = N - 99 + 9
elif digits == 5:
    res = N - 9999 + 909
else:
    res = -1

print(res)

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

for i in range(1,N+1):
    if i < 10:
        count+=1
    elif i<100:
        count+=0
    elif i<1000:
        count+=1
    elif i<10000:
        count+=0
    elif i<100000:
        count+=1

print(count)

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())

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

Solution (Python):
N = int(input())
N_bit = len(str(N))
ans=0
if N_bit%2==0:
  if N_bit==6:
    ans=90909
  elif N_bit==4:
    ans=909
  elif N_bit==2:
    ans=9
else:
  if N_bit==5:
    ans+=909
    ans+=N-10000+1
  elif N_bit==3:
    ans+=9
    ans+=N-100+1
  elif N_bit==1:
    ans+=N-1+1
print(ans)

Solution (Python):



n = int(input())
d = len(str(n))
count = 0
ans = n

for i in range(d):
    if i%2 == 0: count += min(ans, 9*(10**i))
    ans -= 9*(10**i)

print(count)

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

res = 0 

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

print(res)

Solution (Python):
def main():
    value = int(input())
    count = 0
    while value > 0:
        if len(str(value)) % 2 != 0:
            count += 1
        value -= 1
    print(count)
if __name__ == "__main__":
    main()

Solution (Python):
value = int(input())
count = 0
while value > 0:
    if len(str(value)) % 2 != 0:
        count += 1
    value -= 1
print(count)

Solution (Python):

import sys, math, fractions, itertools


def solve(N: int):
    k = math.floor(math.log10(N))
    counter = 0
    if k == 0:
        counter = N
    if k == 1:
        counter = 9
    if k == 2:
        counter = 9 + (N - 99)
    if k == 3:
        counter = 909
    if k == 4:
        counter = 909 + (N - 9999)
    if k == 5:
        counter = 90909
    print(counter)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
import math as m

def has_odd_digits(i):
  if i > 10**5:
    raise Exception("?")
  if 0 <= i and i <= 9:
    return True
  elif 100 <= i and i <= 999:
    return True
  elif 10000 <= i and i <= 99999:
    return True
  return False

n = int(raw_input())



x = m.log(n, 10)

p = 0
for i in xrange(n):
  if has_odd_digits(i+1):
    p += 1
print p

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

count = 0
for i in range(1,n+1):
  digit = 0
  while i  > 0:
    i //= 10
    digit += 1
  
  if digit % 2 == 1:
    count += 1

print(count)

Solution (Python):
def solve(n):
    ans = 0
    for i in range(1, n+1):
        if (i < 10) or (10**2 <= i < 10**3) or (10**4 <= i < 10**5):
            ans += 1
    return ans

n = int(input())
print(solve(n))

Solution (Python):
n=input()
ans=0
nl=len(n)
if nl==1:
    print(n)
    exit()
if nl>1:
    ans+=9
if nl==3:
    ans+=int(n)-99
    print(ans)
    exit()
if nl>3:
    ans+=900
if nl==5:
    ans+=int(n)-9999
if nl==6:
    ans+=90000
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):
from sys import stdin
a = int(stdin.readline().rstrip())
b = len(str(a))
c = b//2
d = 0
if b == 1:
    print(a)
elif b % 2 == 0:
    for i in range(c):
        d += (10**(2*i+1)-10**(2*i))
    print(d)
else:
    for s in range(c):
        d += (10**(2*s+1)-10**(2*s))
    d += a-(10**(2*c))+1
    print(d)

Solution (Python):
keta_count=1
N=int(input())
i=N
while i >=10:
     i=i//10
     keta_count+=1
      
if keta_count==1: 
    count=N
elif keta_count%2==0: 
    x=keta_count/2 
    count=0
    while x > 0:
        count+=9*100**(x-1)
        x-=1
else: 
    x=(keta_count-1)/2 
    count=0
    while x > 0:
        count+=9*100**(x-1)
        x-=1
    count+= N+1-10**(keta_count - 1)

print(str(round(count)))