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):
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; ansli = []; tmpli = []; candili = []
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def s_list(): return list(input())
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]
def mi(n): return [wi() for _ in range(n)]
def num__grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def grid(n): return [s_list() for _ in range(n)]

n = i()

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

Solution (Python):
a = int(input())
count = 0
for i in range(1,a+1):
  if int((len(str(i))) % 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())
n_d=len(str(n))
ans=0
if n_d >1:
	for i in range(1,n_d,2):
		part1=9
		part2=10**i
		total=part1*part2
		total=total//10
		ans+=total
if n_d%2!=0:		
	part1=10**(n_d-1)
	part2=n-part1
	ans+=(part2+1)
print(int(ans))

Solution (Python):
n = int(input())
str_n = str(n)
keta = len(str_n)
res = 0
for num in range(1, keta, 2):
  res += 9 * (10 ** (num - 1))
if(keta % 2 == 1):
  last = 0
  if(keta == 1):
    last = n
  else:
    last = (n - 10 ** len(str_n[1:])) + 1
  res += last
print(res)

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

keta = len(str(N))

count = 0

if N >= 10:
  
  count += 9
  
  for i in range(3, keta, 2):
    count += (10 ** (i) - 10 ** (i - 1))

  if (keta  % 2) != 0:
    count += (N - 10 ** (keta - 1) + 1)
  
else:
  count = N
  
print(count)

Solution (Python):
def log(n):
    cnt=0
    for i in range(10):
        n=n//10
        cnt+=1
        if(n==0):
            break
    return cnt

N=int(input())
ans=0
for i in range(1,N+1):
    if(log(i)%2==1):
        ans+=1

print(ans)

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

Solution (Python):
s = input()
sl = len(s)
N = int(s)
if sl == 1:
    print(N)
elif sl == 2:
    print(9)
elif sl == 3:
    g = 9
    g += (N-100)+1
    print(g)
elif sl == 4:
    print(909)
elif sl == 5:
    g = 909
    g += N-10000+1
    print(g)
elif sl == 6:
    print(90909)

Solution (Python):
def get_ander_odds_digits(n):
    return [i for i in range(1, n + 1) if i % 2 == 1]

def get_number_of_odds(odd_list):
    return sum([9 * 10 ** (i - 1) for i in odd_list])

n = int(input())
number_of_digits = len(str(n))
answer = 0
if number_of_digits % 2 == 1:
    answer = n - 10 ** (number_of_digits - 1) + 1
number_of_digits -= 1

ander_odds_digits = get_ander_odds_digits(number_of_digits)
answer += get_number_of_odds(ander_odds_digits)
print(answer)

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

num = len(str(N))

a =N%10**(num)


if num==1:
    print(N)
else:
    sum_=0
    for i in range(0,num-1,2):
        sum_+=9*(10**i)
    if num%2!=0:
        sum_+=(N-(10**(num-1))+1)
    print(sum_)

Solution (Python):
n = input()
ans = 0
if len(n) % 2 == 0:
    length = len(n) - 1
    for i in range(length, -1, -2):
        if i == 1:
            ans += 9
        else:
            plus = '9' * i
            minus = '9' * (i - 1)
            ans += (int(plus) - int(minus))
    print(ans)
else:
    if int(n) <= 9:
        print(int(n))
    else:
        length = len(n)
        b = '9' * (length-1)
        c = int(n) - int(b)
        ans += c
        for i in range(length-2, -1, -2):
            if i == 1:
                ans += 9
            else:
                plus = '9' * i
                minus = '9' * (i-1)
                ans += (int(plus) - int(minus))
        print(ans)

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

if N==100000:
  print(90909)
elif N>=10000:
  print(1+N-10000+909)
elif N>=1000:
  print(909)
elif N>=100:
  print(1+N-100+9)
elif N>=10:
  print(9)
elif N>=0:
  print(N)

Solution (Python):

def main():
    n = int(input())
    d = len(str(n))
    if d == 6:
        ans = 90909
    elif d in (4, 5):
        ans = 909 + max(0, n - 9999)
    elif d in (2, 3):
        ans = 9 + max(0, n - 99)
    else:
        ans = n
    print(ans)


if __name__ == "__main__":
    main()

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

num = [1,10,100,1000,10000, 100000]
num2 = {1:9, 100:900, 10000:90000}
num3 = {1:1,2:10,3:100,4:1000,5:10000, 6:100000}
count = 0

for n in num:
    if len(str(n)) % 2 == 0: continue
    if len(str(N)) > len(str(n)):


        count += num2[n]

if len(str(N)) % 2 != 0:

    count += N-num3[len(str(N))]+1

print(count)

Solution (Python):
N = input()

l = len(N)

_sum = 0
if l % 2 == 0:
    for i in range(l):
        _sum += 9*10**(i) if i % 2 == 0 else 0
else:
    for i in range(l-1):
        _sum += 9*10**(i) if i % 2 == 0 else 0
    _sum += int(N) - 10**(l-1) + 1

print(int(_sum))

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

N -= 1 if len(str(N)) == 6 else 0

count += N - 10000 + 1 if len(str(N)) == 5 else 0
count += min(900, N - 100 + 1) if len(str(N)) >= 3 else 0
count += min(9, N) if len(str(N)) >= 1 else 0

print(count)

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


while N > 0:
    num = len(str(N))
    
    if num%2 == 0:
        N -=1
    else:
        count +=1
        N -=1

print(count)

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

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

if digit%2==0:
    for i in range(digit//2):
        ans*=100
        ans+=9
else:
    for i in range(digit//2):
        ans*=100
        ans+=9
    ans+=n-10**(digit-1)+1

print(ans)

Solution (Python):
import math
import numpy as np
a=int(input())
l=(np.arange(a)+1).tolist()

l_odd = [i for i in l if int(math.log10(i)) % 2 == 0]

print(len(l_odd))

Solution (Python):
N = int(input())
def count(start, end):
  return end - start + 1
keta = 1
while True:
  if 10**keta > N:
    break
  else:
    keta += 1
num = 0
for k in range(1, keta+1):
  if k % 2 == 1:
    num += count(10**(k-1), min(N, 10**k-1))
print(num)

Solution (Python):
import math
n = int(input())
k = int(math.log10(n))
ans = 0
if k % 2 == 1:
    for i in range(k):
        if i % 2 == 0:
            ans += 10 ** (i+1) - 10 ** i
    print(ans)
else:
    for i in range(k-1):
        if i % 2 == 0:
            ans += 10 ** (i+1) - 10 ** i
    ans += n - 10 ** k + 1
    print(ans)

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

    ans = 0
    if len(str(N)) % 2 == 0:
        for i in range(len(str(N))):
            if i % 2 == 0:
                ans += 9*(10**i)
    else:
        for i in range(len(str(N))+1):
            if i % 2 == 0:
                ans += 9*(10**i)
        ans = ans - (10**len(str(N)) - N) + 1
        
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):

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

print(cnt)

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)
else:
    print(90909)

Solution (Python):
N=int(input())
tmp=0
if N<10:
  print(N)  
elif N<1000:
  if 9+N-99<0:
    print(9)
  else:
    print(9+N-99)
elif N<100000:
  if 9+900+N-9999<0:
    print(909)
  else:
    print(9+900+N-9999)
elif N==100000:
  print(90909)

Solution (Python):

N = int(input())
sum = 0

for i in range(10000):
  q, mod =divmod(N, 10**(i+1))
  if i == 0:
    if q > 0:
      sum += 9
    else:
      sum += N
      break
  elif i % 2 == 0:
    if q > 0:
      sum += 9*(10**i)
    else:
      mod2 = N - 10**i
      sum += mod2 + 1
      break
  else:
    if q == 0:
      break
      
print(sum)

Solution (Python):
n = input().rstrip()
n_sp = list(map(int, list(n)))
dig  = len(n_sp)
odd = 0
 
if dig == 1:
    print(n_sp[0])

else:
    for i in range(1, dig, 2):
        odd += int("9" * i) - 10 ** (i-1) + 1
 
    if dig%2 == 1:
        odd += int(n) - 10 ** (dig-1) +1
 
    print(odd)

Solution (Python):
n = input()
getDigit = len(n)

if getDigit%2 == 0: digit = getDigit - 1
else : digit = getDigit
x = '9'
x = int(x.rjust(digit,'9'))

n = int(n)
diff = max(x - n,0)
ans = 9

for i in range(1,int(digit/2)+1):
    ans += 100 ** i * 9
    
ans -= diff

print(ans)

Solution (Python):
ns = input().rstrip()
n = int(ns)
k = len(ns)
if k == 1:
    ans = n
else:
    ans = 0
    for i in range(0, k - 1, 2):
        ans += 9 * (10 ** i)
    if k % 2 == 1 and k > 2:
        ans += n - (10 ** (k - 1)) + 1
print(ans)

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)
else:
  print(90909)

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline






















def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

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


if __name__ == "__main__":
	main()

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

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

Solution (Python):
import math

N = int(input())

dig = int(math.log10(N))

num = 0
if dig == 0:
    num = N
elif dig == 1:
    num = 9
elif dig == 2:
    num = 9 + (N - 100 + 1)
elif dig == 3:
    num = 9 + 900
elif dig == 4:
    num = 9 + 900 + (N - 10000 + 1)
elif dig == 5:
    num = 9 + 900 + 90000
print(num)

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

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

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

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

N_length = len(str(N))
ans = 0

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

print(ans)

Solution (Python):
n = int(input())
def calcNum(l):
    if(l == 1):
        return 9
    return 10**l - 10**(l-1)

def getdigit(num):
    digit=0
    while(num != 0):
        num //= 10
        digit+=1
    return digit


digit = getdigit(n)
ans = 0
if(digit % 2 == 0):
    amari = 0
else:
    amari = n - 10**(digit-1)+1


for i in range(0, digit):
    if i % 2 != 0:
        
        ans += calcNum(i)

print(ans+amari)

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

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

for x in range(1, n+1):
    if x < 10 or 100 <= x < 1000 or 10000 <= x < 100000:
        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()
ans = 0
for n in range(1, len(N), 2):
    ans += 9 * 10 ** (n-1)

if len(N) == 1:
    ans = int(N)


elif len(N) % 2 != 0:
    ans += (10 ** (len(N)-1)) * (int(N[0])-1)
    ans += int(N[min(1, len(N)-1):]) + 1


print(ans)

Solution (Python):
N = int(input())
N_1 = len(str(N))
if(N_1 == 1 ):
  print(N)
elif (N_1 == 2):
  print(9)
elif(N_1 == 3):
  print(N-99+9)
elif(N_1 == 4):
  print(909)
elif(N_1 == 5):
  print(N-9999+909)
else:
  print(90909)

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

Solution (Python):
import math
n = str(input()) 
keta = (len(n))
max = int(keta/2)+1

count = 0
t = int(n)
if(keta%2==0):
    for i in range(1,max):
        count += 9*10**((2*(i-1)))
else:
    for i in range(1,max):
        count += 9*10**((2*(i-1)))
    t = t - 10**(keta-1)
    count += t
    count +=1
print(count)

Solution (Python):
cc=list(map(int, input().split()))

NumDig = len(str(cc[0]))


counter = 0

if (NumDig % 2 == 0):
  for idx in range(1, NumDig, 2):
    if idx == 1:
      counter = counter + 10**(idx)-1
    else:
      counter = counter + 10**(idx) - 10**(idx-1)
  
      
if (NumDig % 2 != 0 ):
  for idx in range(1, NumDig, 2):
    if idx == 1:
      counter = counter + 10**(idx)-1
    else:
      counter = counter + 10**(idx)- 10**(idx-1)  
  counter = counter + cc[0] - 10**(NumDig-1) + 1
  
print(counter)

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

Solution (Python):
i = int(input())
100000
i1 = len(str(i))
sum1 = 0
for j in range(1, i1+1):
 if j % 2 == 0:
  sum1 = sum1
 elif j < i1:
  sum1 = sum1 + len(range(10**(j -1), 10**(j)))
 else:
  sum1 = sum1 + len(range(10**(j -1), i + 1 ))


print(sum1)

Solution (Python):
N = int(input())
ans = 0
for x in range(1,10):
    if N >= x:
        ans = ans + 1
for g in range(100,1000):
    if N >= g:
        ans = ans + 1
for m in range(10000,100000):
    if N >= m:
        ans = ans + 1
print(ans)

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

Solution (Python):


n = int(input())
keta = int(len(str(n)))
c = 0



if keta ==1:
    print(n)
elif keta ==2:
    print(9)
elif keta ==3:
    print(9+n-10**2+1)
elif keta == 4:
    print(900+9)
elif keta == 5:
    print(9+900+n-10**4+1)
elif keta == 6:
    print(9+900+90000)

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

for x in range(1, N+1):
    if int(len(str(x))) % 2 != 0:
        count += 1
    else:
        count += 0
        
print(count)

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

Solution (Python):
N=input()
n=len(N)
n=int(n)
num=0
num1=1
num2=1
for i in range(n-1):
    if(i%2==0):
        if(i>1):
            for k in range(i):
                num1=num1*10
                num2=num1
        num1=1
        num+=9*num2

if(int(N)>9):
    if(n%2==1):
        num+=int(N)-num2*100+1
else:
    if(n%2==1):
        num+=int(N)%(num2*100)

print(num)

Solution (Python):

n = int(input())
number_of_digits = len(str(n))
if number_of_digits == 6:
    print(90909)
elif number_of_digits == 5:
    print(90909 - (99999 - n))
elif number_of_digits == 4:
    print(909)
elif number_of_digits == 3:
    print(909 - (999 - n))
elif number_of_digits == 2:
    print(9)
elif number_of_digits == 1:
    print(9 - (9 - n))

Solution (Python):
if __name__ == '__main__':
    N = input()
    l = len(N)

    sum = 0
    for i in range(l):
        if i % 2 == 1:
            continue
        elif i == l - 1:
            sum += int(N) - 10 ** (l - 1) + 1
        else:
            sum += 9 * (10 ** i)

    print(sum)

Solution (Python):



import sys
input = sys.stdin.readline


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

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

    print(count)


if __name__ == '__main__':
    main()

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

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

print(ans)

Solution (Python):
n = list(map(int, input()))
if len(n) == 6:
        print(90909)
elif len(n) == 5:
        num = n[0] * 10000 + n[1] * 1000 + n[2] * 100 + n[3] * 10 + n[4]
        print((num - 10000) + 1 + 900 + 9)
elif len(n) == 4:
        print(909)
elif len(n) == 3:
        num = n[0] * 100 + n[1] * 10 + n[2] * 1
        print((num - 100) + 1 + 9)
elif len(n) == 2:
        print(9)
else:
        num=n[0]*1
        print(num)

Solution (Python):
n= input()
count = 0
if len(n)%2 == 0:
  for i in range(1,len(n),2):
    count += (9 * (10**(i-1)))
else:
  for i in range(1, len(n)-1,2):
    count += (9 * (10**(i-1)))
  count += (int(n)-(10**(len(n)-1))+1)

print(count)

Solution (Python):
n = int(raw_input())
if n < 10:
    print(n)
elif n >= 10 and n < 100:
    print(9)
elif n >=100 and n < 1000:
    print((n-100) + 10)
elif n >=1000 and n < 10000:
    print(909)
elif n >= 10000 and n < 100000:
    print((n-10000) + 910)
elif n == 100000:
    print(90909)

Solution (Python):
import  numpy   as  np

i_N =   int(input())

counter = 0

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

Solution (Python):

import sys
sys.setrecursionlimit(4100000)
a = str(input())
a = a
length = len(a)
b = len(a)
ans = 0
if b == 1:
    print(a)
else:
    for i in reversed(range(1,b+1)):
        if i%2 == 1 and i == b:
            temp = ""
            for k in range(i-1):
                temp += "9"
            ans += int(a[b-i:]) - int(temp)

        elif i%2 == 1:
            temp = 9*10**(i)//10

            ans += temp
    print(ans)

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

print(count)

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

if 1 <= A < 10:
  ans = len(range(1, A + 1))
elif 10 <= A < 100:
  ans = 9
elif 100 <= A < 1000:
  ans = 9 + len(range(100, A + 1)) 
elif 1000 <= A < 10000:
  ans = 9 + 900
elif 10000 <= A < 100000:
  ans = 9 + 900 + len(range(10000, A + 1))
else:
  ans = 9 + 900 + 90000

print(ans)

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

Solution (Python):
N = input()

tmp = len(N)

if tmp == 1:
    print(int(N))
else:
    ans = 0
    for i in range(tmp):
        if i&1 == 1:
            ans += 10**(i) - 10**(i-1)
        elif i == tmp-1:
            ans += int(N) - int("9"*i)

    
    print(ans)

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

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

if (N-10) < 0:
    print(N)
elif(N - 100) < 0:  
    print(9)
elif(N-1000) < 0:
    print(N-90)
elif(N-10000) < 0:
    print(909)
elif(N-100000) < 0:
    print(N-9999+9+900)
elif(N == 100000):
    print(90909)

Solution (Python):
i = input()
j = len(i)
k = int(i)
if j==1:
    print(k)
elif j ==2:
    print(9)
elif j==3:
    print(k-90)
elif j==4:
    print(909)
elif j==5:
    print(k-9999 + 909)
elif j ==6:
    print(90909)

Solution (Python):
n = input()
i = list(n)

r = 0
t = 0
c = 0
for a in i:
    c += 1
    r += t
    t = 0
    if c % 2 == 1:
        
        s = 10 ** (c - 1)
        e = 10 ** c
        t = len(range(s, e))
if c % 2 == 1:
  s = 10 ** (c - 1)
  e = int(n) + 1
  r += len(range(s, e))


print(r)

Solution (Python):
N = input().strip()
d = len(N)
N = int(N)

v = N

for i in range(2, d + 1, 2):
  a = min(10 ** i, N + 1)
  b = 10 ** (i - 1)
  v -= (a - b)

print(v)

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

ans_cnt = 0

for idx in range(a):
	idx_unit = list(str(idx + 1))
	idx_count = 0
	for item in idx_unit:
		idx_count += len(item)
	
	if idx_count % 2 == 1:

		ans_cnt += 1

print(ans_cnt)

Solution (Python):
N = int(input())
N_base = N
i = 1
while True:
    mod = N%10
    N = N//10
    if N == 0 and mod != 0:
        break
    elif N == 0 and mod == 0:
        i += 1
        break
    else:
        i += 1
if i == 1:
    print(N_base)
else:
    num = 0
    for j in range(1,i+1,2):
        if j == i:
            num += N_base - 10**(i-1) + 1
        else:
            num += 10**(j) - 10**(j-1)
    print(num)

Solution (Python):

N = int(input())
if N < 10 :
    L = []
    for i in range(1, N + 1):
        L.append(i)
    print(len(L))

elif 10 <= N < 100:
    L = []
    for i in range(1, 10):
        L.append(i)
    print(len(L))

elif 100 <= N < 1000:
    L = []
    for i in range(1, 10):
        L.append(i)
    for i in range(100, N + 1):
        L.append(i)
    print(len(L))

elif 1000 <= N < 10000 :
    L = []
    for i in range(1, 10):
        L.append(i)
    for i in range(100, 1000):
        L.append(i)
    print(len(L))

elif 10000 <= N < 100000 :
    L = []
    for i in range(1, 10):
        L.append(i)
    for i in range(100, 1000):
        L.append(i)
    for i in range(10000, N + 1):
        L.append(i)
    print(len(L))

elif N == 100000 :
    L = []
    for i in range(1, 10):
        L.append(i)
    for i in range(100, 1000):
        L.append(i)
    for i in range(10000, 100000):
        L.append(i)
    print(len(L))

Solution (Python):
n = int(input())
count = 0
if n == 100000:
  count=90909
elif 10 ** 4 <= n and n < 10 ** 5:
  count = 9 + 900 + n - 10**4 + 1
elif 10**3 <= n and n < 10 **4:
  count = 909
elif 10 ** 2 <= n and n < 10 **3:
  count = 9 + n - 10**2 +1
elif 10 ** 1 <= n and n <10**2:
  count = 9
else:
  count = n
print(count)

Solution (Python):
n = input()
int_n = int(n)
n_len = len(n)

ans = 0
tmp = 0

if n_len == 1:
    ans = int_n
else:
    for i in range(1,n_len):
        if i % 2 == 1:
            ans += (10 ** i) - (10 ** (i-1))
    if (n_len % 2) == 1:
        tmp = int_n - (10**(n_len-1)) + 1
        ans += tmp
print(ans)

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

Solution (Python):
n=int(input())
if n<=9:
  ans=n
elif n<=99:
  ans=9
elif n<=999:
  ans=9+n-99
elif n<=9999:
  ans=909
elif n<=99999:
  ans=909+n-9999
else:
  ans=90909
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(9+900+N-9999)
elif N==100000:
  print(90909)

Solution (Python):
n=int(input())
x=sum=0
while True:
    r1 = 10**x
    r2 = 10**(x+1)
    if n < r1:
        break
    if r1 <= n < r2:
        sum += n - r1 + 1
        break
    else:
        sum += r2 - r1
    x += 2
print(sum)

Solution (Python):
import numpy as np
N = int(input())
array = np.array([n+1 for n in range(N)])
log_array = np.log10(array).astype(np.int) + 1
infer = (log_array % 2 == 1).sum()
print(infer)

Solution (Python):
import math

n = int(input())

c = 0

k = int(math.log10(n)) 

for i in range(k+1):
    if i % 2 == 0 :
        if n < (10 ** (i+1)) :
            c = c + (n - 10 ** i) + 1
        else :
            c = c + (10 ** (i+1) - 10 ** i)

print(c)

Solution (Python):



a = input()

if len(str(a)) == 1:
    print("{}".format(a))
elif len(str(a)) == 2:  
    print("9")
elif len(str(a)) == 3: 
    print("{}".format(int(str(a)) - 90))
elif len(str(a)) == 4:  
    print("909")
elif len(str(a)) == 5:  
    print("{}".format(int(str(a)) - 9090))
else:
    print(90909)

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())
if N < 10:
  print(N)
else:
  if 9 < N < 100:
    print("9")
  else:
    if 99 < N < 1000:
      print(N - 90)
    else:
      if 999 < N < 10000:
        print("909")
      else:
        if 9999 < N < 100000:
          print(909 +  N - 9999)
        else:
          if N == 100000:
            print("90909")

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

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

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

count = 0

if number >=0 and number < 10:  
    count+=number

elif number >=10 and number < 100:  
    count+=9

elif number >= 100 and number < 1000:
    count+=((number - 100) + 1)
    count+=9

elif number >= 1000 and number < 10000:
    count+=(9 + 900)

elif number >= 10000 and number < 100000:
    count=+((number - 10000) + 1)
    count+=(9 + 900)

elif number == 100000:
    count+=9+900+90000 

print(count)

Solution (Python):
import queue

"""
N = int(input())



A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""
N = int(input())
ans = 0
for i in range(1,N+1):
	if i > 0 and i < 10:
		ans += 1
	elif i >= 100 and i < 1000:
		ans += 1
	elif i >= 10000 and i < 100000:
		ans += 1
print(ans)

Solution (Python):
N = int(input())
if N < 10**1:
    print(N)
elif N < 10**2:
    print(9)
elif N < 10**3:
    print(N-99+9)
elif N < 10**4:
    print(909)
elif N < 10**5:
    print(N-9999+909)
else:
    print(90909)

Solution (Python):



n=int(input())
c = len(str(n))


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

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

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):
s = input()
a = int(len(s))
if a == 1:
  print(int(s[0]))
elif a == 2:
  print(9)
elif a == 3:
  print(10+int(s)-100)
elif a == 4:
  print(909)
elif a == 5:
  print(910+int(s)-10000)
elif a == 6:
  print(90909)

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

arr = [(i + 1) for i in range(num) if len(str(i + 1)) % 2 != 0]
print(len(arr))

Solution (Python):


n = int(input())

keta = len(str(n))

count = 0

for i in range(keta):
    
    
    if i == 0:
        continue
    elif i == 1:
        count += 9
    else:
        if i % 2:
            
            count += 10 ** (i-1) * 9


if keta % 2:
    count += n - 10 ** (keta - 1) + 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)
else:
  print(90909)

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

Solution (Python):
n = int(input())
l = len(str(n))
 
i = 0
c = 0
while i < l:
  if i == 0:
    if n < 10:
      c = n
      break
    else:
      c = 9
      i = i + 1
  elif i%2 == 1:
    i = i + 1
    continue
  elif i == (l-1):
    c = c + (n-((10**i)-1))
    i = i + 1
  else:
    c = c + ((10**(i+1))-(10**i))
    i = i + 1
 
print(c)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    n = input().strip()
    int_n = int(n)
    keta = len(n)
    
    
    
    
    
    cnt = 0
    for i in range(1, keta + 1, 2):
        max_num = 10 ** (i) - 1
        min_num = 10 ** (i - 1) - 1
        cnt += max_num - min_num
        if keta == i:
            cnt -= max_num - int_n
    print(cnt)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
m = n
a = 0

i = len(str(n))

if i == 2:
    print(9)
elif i == 4:
    print(909)
elif i == 1:
    print(m)
elif i == 3:
    print(9 + n-99)
elif i == 5:
    print(909 + n-9999)
elif i == 6:
    print(90909)

Solution (Python):
import math

N = int(input())

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

num = 0
if num_digits % 2 != 0:
    num += (N - (10**(num_digits-1)) + 1)

for i in range(num_digits-1):
    if (i + 1) % 2 != 0: 
        num += 9*10**i
    else:
        pass

print(num)

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

Solution (Python):
N = int(input())
ans = 0
if N >= 1 and N <= 9:
    ans = N
    print(ans)
    exit()

ans += 9
if N >= 10 and N <= 99:
    print(ans)
    exit()

if N >= 100 and N <= 999:
    ans += N - 99
    print(ans)
    exit()

ans += 999 - 99
if N >= 1000 and N <= 9999:
    print(ans)
    exit()


if N >= 10000 and N <= 99999:
    ans += N - 9999
    print(ans)
    exit()

ans += 99999 - 9999
if N == 100000:
    print(ans)

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

if N < 10:
  print(N)
elif N > 9 and N < 100:
  print(9)
elif N > 99 and N < 1000:
  print(9 + N - 99)
elif N > 999 and N < 10000:
  print(909)
elif N > 9999 and N < 100000:
  print(909 + N -9999)
else:
  print(90909)

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)
else:
    print(90909)

Solution (Python):
N=int(input())
a=0
for i in range(N):
  if (i+1)//10==0:
    a+=1
  elif (i+1)//100==0:
    a+=0
  elif (i+1)//1000==0:
    a+=1
  elif (i+1)//10000==0:
    a+=0
  elif (i+1)//100000==0:
    a+=1
  else:
    a+=0
print(a)

Solution (Python):
n = input()
 
num = len(n)
 
if num == 1:
  print(n)
elif num == 2:
  print(9)
elif num == 3:
  result = (int(n)-100+1) + 9
  print(result)
elif num == 4:
  print(909)
elif num == 5:
  result = (int(n)-10000+1) + 900 + 9
  print(result)
else:
  print(90909)

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

if 1<=N<10:
    print(N)

elif 10<=N<100:
    print(9)

elif 100<=N<1000:
    x = 9 + N -100 + 1
    print(x)

elif 1000<=N<10000:
    print(909)

elif 10000<=N<100000:
    x = 909 + N -10000 + 1
    print(x)

else:
    print(90909)

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

if d==1:
    print(n)
elif d==2 or d==3:
    c=9
    if d%2==0:
        print(c)
    else:
        print(c+n-10**(d-1)+1)
elif d==4 or d==5:
    c=909
    if d%2==0:
        print(c)
    else:
        print(c+n-10**(d-1)+1)
elif d==6:
    print("90909")

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

ans = 0

for i in range(N+1):
    if ( 1 <= i and i < 10) or (100 <= i and i < 1000) or (10000 <= i and i < 100000):
        ans = ans + 1

print(ans)