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

print(ans)

Solution (Python):
n = int(input()) + 1
r, i = 0, 1
while 10 * i <= n:
    r += 9 * i
    i *= 100
print(r + max(0, n - i))

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

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

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

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

if n < 10:
    ans = n
elif 10 <= n and n < 100:
    ans = 9
elif 100 <= n and n < 1000:
    ans = 9 + n - 99
elif 1000 <= n and n < 10000:
    ans = 909
elif 10000 <= n and n < 100000:
    ans = 909 + n - 9999
elif n == 100000:
    ans = 90909

print(ans)

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

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

p = 1
ans = 0
while 10**p <= N:
    if p&1:
        ans += 10**p - 10**(p-1)
    p += 1

if p&1:
    p -= 1
    ans += N - (10**p) + 1

print(ans)

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

if l == 6:
    ans = 90909
elif l == 5:
    ans = 909 + n - 10000 + 1
elif l == 4:
    ans = 909
elif l == 3:
    ans = 9 + n - 100 + 1
elif l == 2:
    ans = 9
else:
    ans = n 
print(ans)

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

count = 0
while(n1 > 0):
    n1 = n1 // 10
    count = count + 1

if count == 1:
    print(n)
elif count == 2:
    print(9)
elif count == 3:
    print(9 + (n - 100) + 1)
elif count == 4:
    print(909)
elif count == 5:
    print(909 + (n - 10000) + 1)
else:
    print(90909)

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

x= len(str(N))



if(not x%2==0):
    total+= (N-(10**(x-1)))+1
    x -= 1



for i in range(x):
    if (i%2==0):
        total+= 9*(10**i)

print(total)

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


def main():
    N = input().strip()
    ans = 0
    for i in range(0, len(N)-1, 2):
        ans += 9 * 10**i

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

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
a = [9, 99, 999, 9999, 99999, 999999]

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

if c == 1:
  ans = org
elif c == 2:
  ans = a[0]
elif c == 3:
  ans = a[0] + org - a[1]
elif c == 4:
  ans = a[0] -a[1] + a[2]
elif c == 5:
  ans = a[0] -a[1] + a[2] - a[3] + org
else:
  ans = a[0] -a[1] + a[2] - a[3] + a[4]

print(ans)

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

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

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

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

levels = [9, 0, 900, 0, 90000, 0]

if n == 10**5:
    print(sum(levels))
if len(n_) == 5:
    print(sum(levels[:4]) + n - 10000 + 1)
if len(n_) == 4:
    print(sum(levels[:3]))
if len(n_) == 3:
    print(sum(levels[:2]) + n - 100 + 1)
if len(n_) == 2:
    print(sum(levels[:1]))
if len(n_) == 1:
    print(n)

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

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

Solution (Python):

n =  int(input())
s = str(n)
if len(s)==1:
    print(n)
elif len(s)==2:
    print(9)
elif len(s)==3:
    print(n-100+10)
elif len(s)==4:
    print(909)
elif len(s)==5:
    print(n-10000+910)
elif len(s)==6:
    print(90909)

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

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

print(count)

Solution (Python):
n = int(input())
a = 0
for i in [1,3,5]:
    max = pow(10, i)
    min = pow(10, i-1)
    if n >= max-1:
        a += 9 * min
    elif n >= min:
        a += n-min+1
        break
    else:
        break
print(a)

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

cnt = 0
for i in [1, 3, 5]:
    int_quot = n // (10 ** i)
    if n < (10 ** (i - 1)):
        break
    if int_quot == 0:
        cnt += n - 10 ** (i-1) + 1
    else:
        cnt += (10 ** i - 1) - (10 ** (i - 1)) + 1


print(cnt)

Solution (Python):




n = int(input())
x = 0
count = 0

while n >= x:
    n_digit = 0
    xx = x
    while xx != 0:
        xx = xx // 10
        n_digit += 1
    if n_digit % 2 == 1:
        count += 1
    x += 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):
def main():
    n = input()
    if len(n) == 1:
        print(int(n))
    elif len(n) == 2:
        print(9)
    elif len(n) == 3:
        print(10 + int(n) - 100)
    elif len(n) == 4:
        print(909)
    elif len(n) == 5:
        print(910 + int(n) - 10000)
    else:
        print(90909)


if __name__ == '__main__':
    """
    整数 N が与えられます。N 以下の正の整数のうち、(先頭に 0 をつけずに十進法で表記したときの)
    桁数が奇数であるようなものの個数を求めてください。

    制約
    1 ≤ N ≤ 10^5
    """
    main()

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

if n<=9:
    print(n)
elif n<=99:
    print(9)
elif n<=999:
    s=9+n%100+1
    print(9+n-100+1)
elif n<=9999:
    print(909)
elif n<=99999:
    print(909+n-10000+1)
else:
    print(90909)

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

while n-10**i >= 0:
    if not i & 1:
        if n-10**(i+1) < 0:
            ans += n - 10**i + 1
        else:
            ans += 10**i * 9

    i += 1

print(ans)

Solution (Python):


number = int(input())
count = 0

if number < 10:
  count = number
elif 10 <= number < 100:
  count = 9
elif 100 <= number < 1000:
  count += 9
  count += number - 99
elif 1000 <= number < 10000:
  count += 909
elif 10000 <= number < 100000:
  count += 909
  count += number - 9999
elif 100000 <= number :
  count += 90909
  
print(count)

Solution (Python):
n = int(input())
i = 1
r = 0
while 10 * i <= n + 1:
    r += 9 * i
    i *= 100
print(r + max(0, n + 1 - i))

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

def count(x):
    k = len(x) // 2
    for i in range(k):
        if i==0:
            ans = '9'
        else:
            ans += '09'
    return (int(ans))

if le == 1:
    print(int(n))
    exit()

elif le % 2 == 0:
    ans = count(n)
else:
    nn = n[1:]
    ans = count(nn)
    ans += int(n) - 10**(le-1) + 1
print(ans)

Solution (Python):
N = str(input())
m = len(N)
ans = int(N) 
if m == 2:
    ans = 9
elif m == 3:
    ans -= 90
elif m == 4:
    ans = 909
elif m == 5:
    ans -= 10000
    ans += 1
    ans += 909
elif m == 6:
    ans = 90909
print(ans)

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

ans = 0

for i in range(1, x + 1):
  count = 0
  x = i
  while(x > 0):
    count += 1
    x = x // 10
  if count%2 == 1:
    ans += 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 - 90 - 9000)
else:
  print(90909)

Solution (Python):
n = int(input())
res = 0
for i in range(1,n+1):
    t = i
    var = 1
    while i >= 10:
        i = i//10
        var += 1
    if var % 2 ==1 :
        res+=1
    
print(res)

Solution (Python):

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

Solution (Python):
import numpy as np
n=input()
n=int(n)
k=np.log10(n)
k=int(k)
a=0
if k % 2 == 0:
  a+=n-10**k+1
if n>=100000:
  a+=90909
elif n>=1000:
  a+=909
elif n>=10:
  a+=9
print(a)

Solution (Python):
n = int(input())
k = n
cnt = 1
while(n>0):
    if(n>=10):
        
        n = n//10
        cnt += 1
    else:
        break

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

Solution (Python):
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")


def main():
    N = int(input())
    logging.info("Hello!")

    answer = 0

    if N < 10:
        answer = N
    elif N >= 10 and N < 100:
        answer = 9
    elif N >= 100 and N < 1000:
        answer = 9 + N % 100 + 1 + int(N // 100 - 1) * 100
    elif N >= 1000 and N < 10000:
        answer = 909
    elif N >= 10000 and N < 100000:
        answer = 909 + N % 10000 + 1 + int(N // 10000 - 1) * 10000
    else:
        answer = 90909

    print(answer)
        
if __name__ == "__main__":
    main()

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

c = N - 10**(l - 1) + 1 if l % 2 else 0
for i in range(0, l - 1, 2):
  c += 10**(i + 1) - 10**i
print(c)

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

if N == 10**5:
    print(90909)
elif N >= 10**4:
    print(9+len(range(10**2, 10**3))+len(range(10**4, N+1)))
elif N >= 10**3:
    print(9+len(range(10**2, 10**3)))
elif N >= 10**2:
    print(9+len(range(10**2, N+1)))
elif N >= 10:
    print(9)
elif N >= 1:
    print(N)

Solution (Python):
n = int(input())
cnt = 0
for x in range(n+1):
    if 1 <= x and x <=9:
        cnt+=1
    if 100 <= x and x <=999:
        cnt+=1
    if 10000 <= x and x <=99999:
        cnt+=1

print(cnt)

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

if 1 <= n and n < 10:
    print(n)
elif 10 <= n and n < 100:
    print(9)
elif 100 <= n and n < 1000:
    print(9 + n - 100 + 1)
elif 1000 <=n and n < 10000:
    print(9 + 999 - 100 + 1)
elif 10000 <= n and n < 100000:
    print(9 + 999 - 100 + 1 + n - 10000 + 1)
elif 100000 == n:
    print(9 + 999 - 100 + 1 + 99999 - 10000 + 1)

Solution (Python):
n = input()

l = len(n)

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

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

g = 0
output = 0
for i in range(s):
    i = i + 1
    if int(len(str(i)))%2 == 0:
        g=1
    else:
        output = output + 1

        
print(output)

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

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

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

Solution (Python):
test = False


def solve_a(test=False, a=0, b=0, c=0):
    if not test:
        a, b, c = map(int, input().split())
    d = max(c - (a - b), 0)
    print(d)


def solve_b(test=False, n=0):
    if not test:
        n = int(input())
    res = 0
    for i in range(1, n + 1):
        if len(str(i)) % 2 == 1:
            res += 1
    print(res)


def solve_c(test=False, n=0, h_list=[]):
    if not test:
        n = int(input())
        h_list = list(map(int, input().split()))
    res = 'Yes'
    new_h_list = [0] * n
    new_h_list[0] = h_list[0] - 1

    for i in range(1, n):
        
        if h_list[i] == new_h_list[i - 1]:
            new_h_list[i] = h_list[i]
        elif h_list[i] < new_h_list[i - 1]:
            new_h_list[i] = h_list[i]
            res = 'No'
        else:
            new_h_list[i] = h_list[i] - 1
    print(res)


if __name__ == "__main__":
    if test:
        solve_a(test=True, a=6, b=4, c=3)
        solve_a(test=True, a=8, b=3, c=9)
        solve_a(test=True, a=12, b=3, c=7)
        solve_b(test=True, n=11)
        solve_b(test=True, n=136)
        solve_b(test=True, n=100000)
        solve_c(test=True, n=5, h_list=[1, 2, 1, 1, 3])
        solve_c(test=True, n=4, h_list=[1, 3, 2, 1])
        solve_c(test=True, n=5, h_list=[1, 2, 3, 4, 5])
        solve_c(test=True, n=1, h_list=[1000000000])
    else:
        
        solve_b()

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

c = 0

for i in range(6):
    if N >= 10 ** i:
        if i % 2 == 1:
            c += 9 * (10 ** (i - 1))
    else:
        if i % 2 == 1:
            c += N - (10 ** (i - 1)) + 1
        break

print(c)

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

result = 0

def is_odd(number):
    if not number % 2 == 0:
        return True
    else:
        return False

ketasu = len(str(num))
ruizyo = ketasu - 1

if is_odd(ketasu):
  result += (num+1-10**ruizyo)

for i in range(1,10,2):
  if i > ruizyo:
    break
  result += (10**(i))-(10**(i-1))

print(result)

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

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


for i in range(1, n + 1):
    if i < 10:
        cnt += 1
    elif 99 < i and i < 1000:
        cnt += 1
    elif 9999 < i and i < 100000:
        cnt += 1
        
print(cnt)

Solution (Python):
n = int(input())
n2 = n
cnt = 0
while n>0:
	cnt += 1
	n = n // 10
if cnt == 1:
	print(n2)
elif cnt == 2:
	print(9)
elif cnt == 3:
	print(9 + (n2-100+1))
elif cnt == 4:
	print(9 + 900)
elif cnt == 5:
	print(9 + 900 + (n2-10000+1))
elif cnt == 6:
	print(9 + 900 + 90000)

Solution (Python):
N = int(input())
s = str(N)
count = 0
if len(s) == 1:
    count += N
    print(count)
elif 1 < len(s) < 3:
    count += 9
    print(count)
elif len(s) == 3:
    count += 9
    count += N-99
    print(count)
elif 3 < len(s) < 5:
    count += 9 + 900
    print(count)
elif len(s) == 5:
    count += 9 + 900 + N-9999
    print(count)
elif len(s) > 5:
    count += 90909
    print(count)

Solution (Python):
N= input()
 
n= int(N)
first = 9
sencond = 900
thrid = 90000
sum =0
if  len(N) ==1 :
    sum = n
elif len(N) ==2 :
    sum = first 
elif len(N) ==3 :
    sum = first + (n- 99)
elif len(N) ==4 :
    sum = first + sencond
elif len(N) ==5 :
    sum = first +  sencond + (n- 9999) 
elif len(N) ==6 :
    sum = first +  sencond + thrid
print(sum)

Solution (Python):
N = input()

if len(N) % 2 == 0:
    C = len(N) - 1
    if C == 5:
        print('90909')
    elif C == 3:
        print('909')
    elif C == 1:
        print('9')

elif len(N) % 2 == 1:
    if len(N) == 5:
        C = int(N) - 9999
        print(C+909)
    elif len(N) == 3:
        C = int(N) - 99
        print(C+9)
    elif len(N) == 1:
        print(N)

Solution (Python):
N = int(input())
if N < 10:
    l = range(N)
else:
    l = range(1, N + 1)

counter = 0
for s in l:
    n = len(str(s))
    if n % 2 == 1:
        counter += 1
print(counter)

Solution (Python):
import sys







"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


class Idea:
    def __init__(self):
        pass

    def HF(self, p):
        """
        Half enumeration
        半分全列挙です
        pの要素の和の組み合わせを作ります。
        ソート、重複削除行います
        :param p: list : 元となるリスト
        :return: list : 組み合わせられた和のリスト
        """
        return sorted(set(p[i] + p[j] for i in range(len(p)) for j in range(i, len(p))))

    def Bfs2(self, a):
        """
        bit_full_search2
        bit全探索の改良版
        全探索させたら2進数のリストと10進数のリストを返す
        :return: list２つ : １個目 2進数(16桁)  2個目 10進数
        """
        
        
        
        value = []
        for i in range(1 << len(a)):
            output = []

            for j in range(len(a)):
                if self.bit_o(i, j):
                    """右からj+1番目のiが1かどうか判定"""
                    
                    output.append(a[j])
            value.append([format(i, 'b').zfill(16), sum(output)])

        value.sort(key=lambda x: x[1])
        bin = [value[k][0] for k in range(len(value))]
        val = [value[k][1] for k in range(len(value))]
        return bin, val

    def S(self, s, r=0, m=-1):
        """
        ソート関係行います。色々な設定あります。
        :param s: 元となるリスト
        :param r: reversするかどうか 0=False 1=True
        :param m: （2次元配列）何番目のインデックスのソートなのか
        :return: None
        """
        r = bool(r)
        if m == -1:
            s.sort(reverse=r)
        else:
            s.sort(reverse=r, key=lambda x: x[m])

    def bit_n(self, a, b):
        """
        bit探索で使います。0以上のときにTrue出します
        自然数だからn
        :param a: int
        :param b: int
        :return: bool
        """
        return bool((a >> b & 1) > 0)

    def bit_o(self, a, b):
        """
        bit探索で使います。1のときにTrue出すよ
        oneで1
        :param a: int
        :param b: int
        :return: bool
        """
        return bool(((a >> b) & 1) == 1)

    def ceil(self, x, y):
        """
        Round up
        小数点切り上げ割り算
        :param x: int
        :param y: int
        :return: int
        """
        return -(-x // y)

    def ave(self, a):
        """
        平均を求めます
        :param a: list
        :return: int
        """
        return sum(a) / len(a)

    def gcd(self, x, y):
        if y == 0:
            return x
        else:
            return self.gcd(y, x % y)

    def lcm(self, x, y):
        return (x * y) // self.gcd(x, y)


"""ここからメインコード"""


def make_divisors(n):
    
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            
            return i
            
            


def n_to_10(X, n):
    if int(X / n):
        return n_to_10(int(X / n), n) + str(X % n)
    return str(X % n)


def main():
    
    r, e = range, enumerate
    ip = IP()
    id = Idea()
    """この下から書いてね"""
    n = int(input())
    ans = 0
    for i in range(n):
        i += 1
        memo = str(i)
        if len(memo) % 2 == 1:
            ans += 1
    print(ans)


main()

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

Solution (Python):
N=int(input())
r =0
def keta(n):
  c=0
  while 10**c<=n+1:
    c=c+1
  return(c)
  
for i in range(N):
  if keta(i) % 2 == 1:
    r=r+1
    
print(r)

Solution (Python):
n = input()

l = len(n)

ans = 0
j = 1
for i in range(1, l, 2):
    ans += 9 * j
    j *= 100

if l % 2 == 0:
    print(ans)
else:
    ans += (int(n[0]) - 1) * j
    if l != 1:
        ans += int(n[1:]) + 1
    else:
        ans += 1
    print(ans)

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 = math.log10(n)
if dig<1:
    print(n)
elif 1 <= dig and dig < 2:
    print(9)
elif 2 <= dig and dig < 3:
    print(9+n-99)
elif 3 <= dig and dig < 4:
    print(9+999-99)
elif 4 <= dig and dig < 5:
    print(9+999-99+n-9999)
else:
    print(9+999-99+99999-9999)

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

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


for i in range(6):
    if 0 < n // 10 ** i < 10:
        k = i
        break
count = 0
if k % 2 == 0:
    while k >= 0:
        count += n - 10 ** k + 1
        k -= 2
        n = 10 ** (k + 1) - 1
elif k % 2 == 1:
    k -= 1
    n = 10 ** (k + 1) - 1
    while k >= 0:
        count += n - 10 ** k + 1
        k -= 2
        n = 10 ** (k + 1) - 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):
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 == 100000:
    print("90909")
elif N > 9999:
    print(N - 9090)
elif N > 999:
    print("909")
elif N > 99:
    print(N - 90)
elif N > 9:
    print("9")
else:
    print(N)

Solution (Python):
n = int(input())
s = 0
for i in range(1, 6, 2):
  if n >= 10 ** i:
    s += 9 * (10 ** (i - 1))
  else:
    tmp = n - (10 ** (i - 1)) + 1
    if tmp > 0:
      s += tmp
    break
print(s)

Solution (Python):
def calc(N):
    result = 0
    i = 1
    while (True):
        if (N >= i * 10):
            result += 9 * i
        else:
            result += max(0, N - i + 1)
            return result
        i *= 100

N = int(input())
print(calc(N))

Solution (Python):
import math

N = int(input())
cnt = 0

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

print(cnt)

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

count = 0

if N <= 9:
  print(N)
else:
  for i in range(1, N+1, 1):
    i_str = str(i)
    if (len(i_str)%2) != 0:
        count = count + 1
  print(count)

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

import math
order = int(math.log10(int(N)))
ans = 0

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

if (order % 2) == 0:
    a = N - 10 ** order
    ans += a + 1 

print(ans)

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

count = 0

if N >= 10:
    count += 9
else:
    count += N

if N < 100:
    print(count)
    exit(0)

if N >= 1000:
    count += 1000 - 100
else:
    count += N - 99
    print(count)
    exit(0)

if N < 10000:
    print(count)
    exit(0)

if N >= 100000:
    count += 100000 - 10000
else:
    count += N - 9999

print(count)
exit(0)

Solution (Python):
s = int(input())
count = 0
for i in range(s+1):
  g = str(i)
  a = len(g)
  if a % 2 != 0:
    count += 1
print(count-1)

Solution (Python):
import math

n = int(input())

dig_max = math.floor(math.log10(n))

num = 0
for i in range(0, dig_max, 2):
    num += 9 * (10**i)

if dig_max % 2 == 0:
    num += n - 10**dig_max + 1

print(num)

Solution (Python):

N = int(input())
"""
N = 100
"""
N_digits = len(str(N))

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

else:
    for i in range(0,int((N_digits-1)/2)):
        ans += 9*10**(2*i)
    ans += N - 10**(N_digits-1) + 1

print(ans)

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

if(n < 10):
    ans = n
elif(10 <= n and n < 100):
    ans = 9
elif(100 <= n and n < 1000):
    ans = (n - 90)
elif(1000 <= n and n < 10000):
    ans = 909
elif(10000 <= n and n < 100000):
    ans = (n-9090)
else:
    ans = 90909

print(ans)

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

count = 0
i = 0
while True:
    if N >= 10 ** i:
        count += min(N, 10 ** (i + 1) - 1) - 10 ** i + 1
        i += 2
    else:
        break

print(count)

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

  elif 10**i > n and i%2==0:
    break
  elif 10**i > n and i%2==1:
    ans += n - 10**(i-1) + 1
    break

print(ans)

Solution (Python):
strN = input()
keta, N = len(strN), int(strN)
if keta > 1:
  amari = N - (10**(keta-1))
  count = 0
  for i in range(1, keta):
    if i%2!=0:
      if i==1:
        count += 9
      else:
        count += (10**i) - (10**(i-1))  
  if keta%2!=0:
    count += amari+1
  print(count)
else:
  print(N)

Solution (Python):


N = int(input())

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

print(check)

Solution (Python):
a = input()
sum = 0
if len(a) % 2 == 0:
    for i in range(1, len(a), 2):
        sum += (10 ** (i - 1)) * 9

else:
    for j in range(1, (len(a)-1), 2):
        sum += (10 ** (j - 1)) * 9
    b = 10 ** int(len(a) - 1)
    s = int(a) - b + 1
    sum += s
print(sum)

Solution (Python):
n=int(input())
s=len(str(n))
if n<10:
    print(n)
else:
    if s%2==0:
        s=s-1
        x=''
        for i in range(s-1):
            if i%2==0:
                x+='9'
            else:
                x+='0'
        x+='9'
        print(x)
    else:
        z=s-2
        x = ''
        for i in range(z - 1):
            if i % 2 == 0:
                x += '9'
            else:
                x += '0'
        x += '9'
        x=int(x)
        x+=n-int('9'*(z+1))
        print(x)

Solution (Python):



from sys import stdin
import math


int_list  = [int(x) for x in stdin.readline().rstrip().split()]


N = int_list[0]



def is_degits_odd(number):
    digits = len(str(number))
    if digits % 2 == 1:
        return 1
    else:
        return 0
cnt = 0
for i in range(N):
    number = N - i 
    if is_degits_odd(number):
        cnt+=1

print(cnt)

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

if n < 10:
	result = n
elif n < 10**2:
	result = 9
elif n < 10**3:
	result = n -90
elif n < 10**4:
	result = 909
elif n < 10**5:
	result = n -9090
else:
	result = 90909

print(result)

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

Solution (Python):
n=int(input())
 
count=0
 
if n == 100000:
  count+=90909

if 10000 <= n and n < 100000:
  m=n-9999
  count+=m
  count+=909

if 1000 <= n and n < 10000:
  count+=909

if 100 <=n and n < 1000:
  l=n-99
  count+=l
  count+=9

if 10 <= n and n < 100:
  count +=9

if n < 10:
  count+=n

print(count)

Solution (Python):
i = input()

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

if len(i)%2==0:
  print(acc)
else:

  addition = (int(i[0])-1)*10**(len(i)-1)+1
  if len(i)>1:
    addition += int(i[1:])
  print(acc+addition)

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

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


ans = 0
if N > 9:
  ans = 9
  if N > 1000:
    ans = ans + 999 - 99
    if N >= 100000:
      ans = ans + 99999 - 9999
    elif N >= 10000:
      ans = ans + N - 9999
  elif N >= 100:
    ans = ans + N - 99
else:
  ans = N
print(ans)

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

Solution (Python):
N = int(input())
import numpy as np
v = np.array([0, 10**1 - 1, 0, 10**3 - 10**2, 0, 10**5 - 10**4])
n = np.log10(N)
i = int(np.floor(n))
cnt = np.sum(v[:i+1]) 
if i in [0, 2, 4]:
    cnt += (N - 10 ** i + 1)
print(cnt)

Solution (Python):
N=int(input())
X=0
if N<=9:
  X=N
elif N<=99:
  X=9
elif N<=999:
  X=9+(N-100+1)
elif N<=9999:
  X=9+900
elif N<=99999:
  X=909+(N-10000+1)
elif N<=100000:
  X=90909
print(X)

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

count = 0

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

print(count)

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

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

Solution (Python):
a=int(input())
b=a
r=0
x=10
if x<a:
  r+=9
  x=1000
  if x<a:
    r+=900
    x=100000
    if x==a:
       r+=90000
    else:
       r+=max(0,a-9999)
  else:
    r+=max(0,a-99)
else:
  r+=9 if a==10 else a
print(r)

Solution (Python):

N = int(input())
S = str(N)
s = len(S)
ans = 0
for i in range(s//2):
    I = 2*i
    ans+=(10**(I))*9
if s%2 == 1:
    ans+=N-10**(s-1)+1
print(ans)

Solution (Python):
N=int(input())
NN=str(N)
n=len(NN)
data=[9,900,90000]
result=0
if(n==1):
	result=N
if (n==2):
	result=data[0]
if (n==3):
	result=data[0]+N-99
if(n==4):
	result=data[0]+data[1]
if(n==5):
	result=data[0]+data[1]+N-9999
if(n==6):
	result=data[0]+data[1]+data[2]

print(result)

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

ans = 0

def main(n):  
    if n >= 10000:
        ans = n-10000+1 + 900 + 9
        if n == 100000:
            ans -= 1
        return ans

    if n>=1000:
        ans = 909
        return ans

    if n >= 100:
        ans = n - 100 + 1 + 9
        return ans

    if n >= 10:
        ans = 9
        return ans

    if n>= 1:
        ans = n
        return ans

print(main(n))

Solution (Python):
if __name__ == '__main__':
    n = input()
    n_keta = len(n)
    dp = [0 for _ in range(n_keta)]
    for i in range(n_keta):
        i_result = 10 ** (i + 1) - 1
        for j in range(i):
            i_result -= dp[j]
        dp[i] = i_result

    result = 0
    for i in range(0, n_keta, 2):
        result += dp[i]

    if n_keta % 2 != 0:
        result -= 10 ** n_keta - 1 - int(n)

    print(result)

Solution (Python):
n = input()
m = tuple(n)
n = int(n)
ans = 0
keta = len(m)
if keta%2 == 1:
    for i in range(keta-1):
        if (i+1)%2 == 0:
            ans += (10**(keta-(i+1)))*9
    print(n-ans)
else:
    for i in range(keta):
        if (i+1)%2 == 0:
            ans += (10**(keta-(i+1)))*9
    print(ans)