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 sys

fin = sys.stdin.readline
num = str(fin()).split()[0]

sum = 0
for i in range(len(num) // 2):
    sum += 9 * (10 ** (i*2))

if len(num) % 2 == 0:
    
    print(sum)
else:
    print(sum + int(num) - 10 ** (len(num) - 1) + 1)

Solution (Python):


def solve():
    res = len(tuple(0 for i in range(int(input())) if len(str(i+1))%2))
    
    return str(res)

if __name__ == '__main__':
    print(solve())

Solution (Python):
import math


def main(n):
    
    count = 0
    for i in range(1, n + 1):
        keta = int(math.log10(i) + 1)
        if (keta % 2) == 1:
            count += 1
    return count


if __name__ == '__main__':
    n = int(input())
    print(main(n))

Solution (Python):
N = int(input())
L = len(str(N))

ans = 0

for l in range(1, L, 2):
    if l != L:
        ans += 9 * 10 ** (l-1)

if L % 2 == 1:
    ans += N - (10 ** (L-1) - 1)

print(ans)

Solution (Python):
N = int(input())
N_uneven = 0
for i in range(1,N+1):
   if i>0 and i<10:
       N_uneven+=1
   elif i>99 and i<1000:
       N_uneven+=1
   elif i>9999 and i <100000:
       N_uneven+=1
   else:
       pass
print(N_uneven)

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

Solution (Python):
a  = input()

ans = 0

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

print(ans)

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())
if N<10:
    print(N)
elif 10<=N<100:
    print(9)
elif 100<=N<1000:
    print(9 + (N - 99))
elif 1000<=N<10000:
    print(9 + 900)
elif 10000<=N<100000:
    print(9 + 900 + (N - 9999))
else:
    print(9 + 900 + 90000)

Solution (Python):
N = input()

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

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

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

print(count)

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<=99999):
  print(n-9090)
  
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())

hitoketa = min(max(N - 0,0), 9)
sanketa = min(max(N - 99,0), 900)
goketa = min(max(N - 9999, 0), 90000)


print(hitoketa + sanketa + goketa)

Solution (Python):
inpl = lambda: list(map(int,input().split()))
N = int(input())
ans = 0
for i in range(1,N+1):
    if len(str(i)) % 2:
        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())

ans=0
if n<=9:
  ans=n
elif n<=99:
  ans = 9
elif n<=999:
  ans = 9 + n-100+1
elif n<=9999:
  ans = 9+ 999-100+1
elif n<=99999:
  ans = 9+ 999-100+1 +n-10000 +1
elif n<=999999:
  ans = 9+ 999-100+1 +99999-10000 +1
elif n==100000:
  ans = 9+ 999-100+1 +99999-10000 +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):
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 <= 9:
  print(N)
elif N >= 10 and N <= 99:
  print(9)
elif N >= 100 and N <= 999:
  print(9+N-100+1)
elif N >= 1000 and N <= 9999:
  print(909)
elif N >= 10000 and N <= 99999:
  print(909+N-10000+1)
elif N == 100000:
  print(90909)

Solution (Python):
def int_multiple():
    return  [int(c) for c in input().split()]

def int_single():
    return int(input())

def str_multiple():
    return [c for c in input().split()]

def str_single():
    return input()



n = int_single()

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

print(r)

Solution (Python):
N = int(input())
nums = len(str(N))

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

Solution (Python):
n = int(input())
if n >= 10**5:
  print(90909)
elif n >= 10**4:
  print(n - 10000 + 910)
elif n >= 10**3:
  print(909)
elif n >= 10**2:
  print(n - 100 + 10)
elif n >= 10**1:
  print(9)
elif n >= 10**0:
  print(n)

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

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

Solution (Python):
import sys


def main():
    n = int(sys.stdin.readline().strip())

    def digit(num):
        if num < 10:
            return 1
        return digit(num // 10) + 1

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


main()

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

def digits(n):
    dig = 1
    n //= 10
    while n:
        dig += 1
        n //= 10
    return dig

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

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

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

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

keta = len(str(N))
if keta == 1:
    ans = N
elif keta == 2:
    ans = 9
elif keta == 3:
    ans = N-90
elif keta == 4:
    ans = 909
elif keta == 5:
    ans = N-90-9000
else:
    ans = 90909

print(ans)

Solution (Python):
import math
 
N = int(input())
 
count = 0
for i in range(1, N+1):
  if math.floor(math.log10(i)) % 2 == 0:
    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 = ans + 1
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
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 II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

debug = True


def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    N = II()

    
    if N == 10**5:
        print(90909)
        return
    
    if N > 9999:
        print(N-10000+1+909)
        return

    
    if N > 999:
        print(900+9)
        return

    
    if N > 99:
        print(N-100+1 + 9)
        return

    
    if N > 9:
        print(9)
        return

    
    print(N)


solve()

Solution (Python):
import math


def get_num():
    return int(input())


n = get_num()
max_digit = math.floor(math.log10(n))
cnt = 0
for i in range(0, max_digit, 2):
    cnt += (10 ** (i + 1) - 10 ** i)

if max_digit % 2 == 0:
    cnt += (n - 10 ** max_digit + 1)

print(cnt)

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

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

Solution (Python):
N = input()

counter = 0

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

print(counter)

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

ans = 0

if 1 <= 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())

if n == 100000:
  print(90909)
elif 10000 <= n <= 99999:
  print(909 + n - 9999)
elif 1000 <= n <= 9999:
  print(909)
elif 100 <= n <= 999:
  print(9 + n - 99)
elif 10 <= n <= 99:
  print(9)
else:
  print(n)

Solution (Python):
N = int(input())
A1, A2, A3 = 9, 900, 90000

if len(str(N))%2 == 0:
  if N < 100 :
    print(A1)
  elif 100< N < 10000:
    print(A1 + A2)
  else:
    print(A1 + A2 + A3)
else:
  if N < 10:
    print(N)
  elif 10< N < 1000:
    print(N - 99 + A1)
  else:
    print(N - 9999 + A1 + A2)

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

if 1 <= n < 100:
    print(min(9, n))
elif 100 <= n < 10000:
    print(min(909, n - 99 + 9))
elif 10000 <= n <= 100000:
    print(min(90909, n - 9999 + 909))

Solution (Python):
s=input()

a=int(s)

n = len(s)

m = int((n) /2)

ans = 0
for i in range(m):
    ans += 9 * (100 ** i)

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

print(ans)

Solution (Python):
N=int(input())
count=0
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(9+999-100+1)
elif 10000<=N<=99999:
  print(9+999-100+1+N-10000+1)
else:
  print(9+999-100+1+99999-10000+1)

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

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

    print(count)


main()

Solution (Python):


import sys

n= int(sys.stdin.readline())

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

Solution (Python):
N=int(input())
ans=0
if N<10**1:
  ans=N
elif N<10**2:
  ans=9
elif N<10**3:
  ans=N-90
elif N<10**4:
  ans=909
elif N<10**5:
  ans=N-9000-90
else:
  ans=90909
print(ans)

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

n = int(input())

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

print(counter)

Solution (Python):
import numpy as np
n = int(input())

ans = 0

keta = int(np.log10(n))

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

Solution (Python):
N = int(input())
ans = 0
for i in range(1,N+1):
    if ((10<=i and i<=99) or (1000<=i and i<=9999) or i ==100000):
        continue
    else:
        ans += 1 


print(ans)

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

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

Solution (Python):
N = int(input())
if N <= 9:
    ans = N
elif N <= 99:
    ans = 9
elif N <= 999:
    ans = N - 90
elif N <= 9999:
    ans = 909
elif N <= 99999:
    ans = N - 9090
else:
    ans = 90909

print(ans)

Solution (Python):
n = int(input())
ans = 0
if n >= 10000:
    ans += (min(99999, n) - 9999) + 909
elif n >= 100:
    ans += (min(999, n) - 99) + 9
else:
    ans += min(9, n)
print(ans)

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

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

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

if N <= 9:
    ans = N
elif N <= 99:
    ans = 9
elif N <= 999:
    ans = 9 + N - 100 + 1
elif N <= 9999:
    ans = 9 + 900
elif N <= 99999:
    ans = 9 + 900 + N - 10000 + 1
else:
    ans = 9 + 900 + 90000
print(ans)

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

Solution (Python):
n=int(input())
l=len(str(n))
ls=[9,0,900,0,90000,0,900000]
if l%2==0:
    print(sum(ls[:l]))
else:
    ans=sum(ls[:l-1])
    ans+=n-(10**(l-1)-1)
    print(ans)

Solution (Python):
N = int(input())
result = 0
for i in range(N + 1):
    if len(str(i)) % 2 == 0:
        pass
    else:
        result += 1
print(result - 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):

"""
AtCoder A
"""
 
import sys, math, random
import numpy as np
 







inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LLS(): return [list(sys.stdin.readline().rstrip()) for _ in sys.stdin.readlines()]
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()
    out=0
    if N==100000:
        out=90909
    elif N>9999:
        out+=N-9999
        out+=9+900
    elif N>999:
        out+=909
    elif N>99:
        out+=N-99
        out+=9
    elif N>9:
        out+=9
    else:
        out+=N
    print(out)
 
 
 
if __name__ == "__main__":
    main()

Solution (Python):
def main():

    """ convenient functions
    
    
    
    
    
    """

    """convenient decorator
    
    
        
        
        
        
        
        
        
        
        
        
    """
    
    
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product 
    
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  
        b, e = 2, 0  
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict 
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest 
    from copy import deepcopy, copy 
    import operator
    from operator import itemgetter 
    
    
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd 
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    
    
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) 
    def modinv(a, p = MOD):
        
        
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        
        
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    class UnionFindTree:
        """union find tree class
        TODO: fix this description...
        how to use (example):
        >>  uf = UnionFindTree(N) 
        >>  if uf.find_root(a) == uf.find_root(b):
        >>      do something
        >>  else:
        >>      do something
        >>      uf.unite(a, b)
        """
        def __init__(self, N):
            self.root = [-1] * (N+1)
            self.rank   = [0]  * (N+1)
            self.connected_num = [1] * (N+1)
    
        def find_root(self,x):
            root = self.root
            while root[x] != -1:
                x = root[x]
            return x
    
        def unite(self,x,y):
            root = self.root
            rank = self.rank
            connected_num = self.connected_num
            find_root = self.find_root
    
            rx = find_root(x)
            ry = find_root(y)
            if rx != ry:
                if rank[rx] < rank[ry]:
                    root[rx] = ry
                    rx,ry = ry,rx
                else:
                    if rank[rx] == rank[ry]:
                        rank[rx] += 1
                    root[ry] = rx       
                connected_num[rx] += connected_num[ry]

    """ initialize variables and set inputs
    
        
        
    
        
        
        
        
        
        
        
    
        
        
        
        
    
        
        
    """

    
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    
    
    
    
    
    
    
    """

    if __name__ != '__main__':
        
        sys.stdin = open('sample.txt')
        
    
    

    N = r()
    length = len(N)
    intN = int(N)
    ans = 0
    for i in range(1,length,2):
        ans += 9 * (10**(i-1))
    if length%2 != 0:
        ans += intN-10**(length-1) + 1
    print(ans)
    
    
    
    

    """memo: how to use defaultdict of list
    
    Dic = defaultdict(list)
    
    Dic[x].append(y)
    
    for k, v in Dic.items():
    """
    
    """memo: how to solve binary problems
    
    >>> a = 5
    >>> bin_str_a = format(a, '
    >>> print(bin_str_a)
    0b0101 
    """
    
    """memo: how to solve the problem
    creating simple test/answer
    greed
    simple dp
    graph
    """

if __name__ == '__main__':
    main()

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

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

print(cnt)

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

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

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n+1):
    if 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())

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

print(ans)

Solution (Python):
n=input()
length=len(n)
if length==1:
    print(n)
elif length==2:
    print(9)
elif length==3:
    print(9+int(n)-99)
elif length==4:
    print(9+900)
elif length==5:
    print(9+900+int(n)-9999)
else:
    print(9+900+90000)

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

len_n = len(str(N)) 

count = 0 

if len_n == 1:
  count += N
elif len_n == 2:
  count += 9
elif len_n == 3:
  count += 9
  count += (N - 99)
elif len_n == 4:
  count += 909
elif len_n == 5:
  count += 909
  count += (N - 9999)
elif len_n == 6:
  count += 90909
  
print(count)

Solution (Python):

def main():
    n = int(input())
    d = len(str(n))
    if d == 6:
        ans = 9 + 900 + 90000
    elif d == 5:
        ans = 9 + 900 + n - 9999
    elif d == 4:
        ans = 9 + 900
    elif d == 3:
        ans = 9 + n - 99
    elif d == 2:
        ans = 9
    elif d == 1:
        ans = n
    print(ans)


if __name__ == "__main__":
    main()

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(9+900)
elif n < 100000:
  print(9+900+(n-9999))
else:
  print(90909)

Solution (Python):
n = int(input())
s = list(map(str, range(n+1)))
s.pop(0)


count = 0
for i in range(n):
    if len(s[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):



if __name__ == '__main__':
    n = int(input())
    num = 0
    for i in range(n):
        if len(str(i+1)) % 2 == 1:
            num += 1
    print(num)

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

Solution (Python):
n=int(input())
if n<10:print(n)
elif n<100:print(9)
elif n<10**3:print(n-90)
elif n<10**4:print(909)
elif n<10**5:print(n-9090)
else: print(90909)

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

n = N
digit = 0
while n > 0:
    n //= 10
    digit += 1



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

if digit % 2 == 1:
    ans += N + 1 - (10**(digit - 1))
print(ans)

Solution (Python):
import math

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

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

ans = 0

for i in range(n+1):
  
    if 1<=i<=9:
      ans += 1
      continue
    if 100<=i<=999:
      ans += 1
      continue
    if 10000<=i<=99999:
      ans += 1
      continue
print(ans)

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

ans = 0

for i in range(1, n+1):
    if len(list(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):
import sys
input = sys.stdin.readline

N = int(input())

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

for a in range(A-1):
    if a % 2 != 0:
        continue
    ans += 9*10**a

if A % 2 != 0:
    ans += N - 10**(A-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())

def digit_num(n):
    for i in range(1, 7):
        if n < 10 ** i:
            return i
    return 6

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

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

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

Solution (Python):
n = input()

if len(n) == 1:
    print(n)
elif len(n) == 2:
    print(9)
elif len(n) == 3:
    print(int(n) - 90)
elif len(n) == 4:
    print(909)
elif len(n) == 5:
    print(int(n) - 9999 + 909)
elif len(n) == 6:
    print(90909)

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

if N <= 99:
    print(min(9,N))
    exit()

if N <= 9999:
    print(min(N - 99 + 9, 999 - 99 + 9))
    exit()

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

Solution (Python):


import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop

def main():
    n = int(input())
    ans = 0
    if n < 10:
        print(n)
        return

    ans = 9  
    if n < 100:
        print(ans)
        return

    if n < 1000:
        ans += (n - 100 + 1)
        print(ans)
        return
    ans += 900  

    if n < 10000:
        print(ans)
        return

    if n < 100000:
        ans += (n - 10000 + 1)
        print(ans)
        return
    ans += 90000  

    print(ans)

if __name__ == '__main__':
    main()

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

if n_keta % 2 == 0:
    total = 0
    for i in range(n_keta // 2):
        total += 10 ** (2*i) * 9
else:
    total = 0
    for i in range(n_keta//2):
        total += 10 ** (2*i) * 9
    total += int(n) - 10 ** (n_keta-1) + 1
print(total)

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

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(9+900)
elif n<100000:
	print(909+n-9999)
else:
	print(90909)

Solution (Python):
n=int(input())
if n<100:
  print(min(9,n))
elif n<10000:
  print(min(909,n-90))
else:
  print(min(90909,n-9090))

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=input()
l=len(n)
c=0
if l%2==0:
  for i in range(1,l,2):
    c+=9*(10**(i-1))
  print(c)
else:
  m=int(n)
  d=m-(10**(l-1))+1
  c+=d
  for i in range(1,l-1,2):
    c+=9*(10**(i-1))
  print(c)

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

cnt = 0
for i in range(1, N + 1):
    if 10 <= i <= 99 or 1000 <= i <= 9999 or i == 100000:
        continue
    else:
        cnt += 1
print(cnt)

Solution (Python):
N=int(input())
s=str(N)
l=len(s)
if l==1:
    print(N)
elif l==2:
    print(9)
elif l==3:
    print(9+(N-99))
elif l==4:
    print(9+900)
elif l==5:
    print(9+900+(N-9999))
elif l==6:
    print(9+900+90000)

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

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

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

T = [9, 900, 90000]
L = len(str(N))

ans = sum(T[i] for i in range(L//2))
if L % 2 == 1:
    ans += N - (10 ** (L-1)) + 1

print(ans)

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

cnt = 0
for i in range(1, n+1):
    l = len(str(i))
    if l % 2 == 1:
        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 = input()
ans = 0
for i in range(1,len(n)+1):
    if i % 2 == 1 and i != len(n):
        ans = ans + 10**i -10**(i-1)
    elif i %2 == 1:
        ans = ans + int(n) - 10**(i-1) + 1
    
print(ans)

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

if N < 10 :
    print(N)
    exit()

if N < 100 :
    print(9)
    exit()

if N < 1000 :
    print(9 + (N - 99))
    exit()

if N < 10000 :
    print(909)
    exit()

if N < 100000 :
    print(909 + (N - 9999))
    exit()

print(90909)