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
input = lambda: sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

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

for i in range(N):
  n_size = int(math.log10(N-i)+1)
  if n_size%2==1:
    count += 1
  else:
    count += 0
  i += 1
print(count)

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

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

Solution (Python):
import sys







input = sys.stdin.readline
sys.setrecursionlimit(10**7)
inf = 10**17
mod = 10**9 + 7

n = int(input())

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

print(ans)

Solution (Python):
print(sum(len(str(-~i))%2>0 for i in range(int(input()))))

Solution (Python):

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

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

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

Solution (Python):
N=int(input())
count=0
for i in range(1,N+1):
    for j in range(0,6):
        if 10**j <=i <10**(j+1):
            ans=j+1
            if (j+1)%2!=0:
                count+=1
                
print(count)

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

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

Solution (Python):
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 = input()
Num = sum(pow(10,x)-pow(10,x-1) for x in range(0,len(N)) if x%2)
if len(N)%2:
    print(Num+int(N)-pow(10,len(N)-1)+1)
else:
    print(Num)

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

Solution (Python):
N=int(input())
count=0
if N//100000==1:
    count=90909
elif N//10000>0:
    count=N%10000+910+((N//10000)-1)*10000
elif N//1000>0:
    count=909
elif N//100>0:
    count=N%100+10+((N//100)-1)*100
elif N//10>0:
    count=9
else:
    count=N//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):
import sys    
import os     
import math

N=int(input())
count=0

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

print(count)

Solution (Python):
import sys


def rec(length):
    if length == 1:
        return 9
    else:
        return 9 * 10**(length - 1) + rec(length - 2)


n = input()
length = len(n)

if length == 1:
    print(n)
    sys.exit()

if length % 2 == 0:
    ans = rec(length - 1)
else:
    ans = rec(length - 2) + int(n) - int("1" + "0" * (length - 1)) + 1

print(ans)

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

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

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

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

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

Solution (Python):
n=int(input())
ans=0
for i in range(1,n+1):
  if len(str(i)) in [1,3,5]:
    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-90)
elif 1000 <= n < 10000:
  print(909)
elif n == 100000:
  print(90909)
else:
  print(n-9090)

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

l = [9, 909, 90909]
ans = 0
if len(n) == 1:
    ans = int(n)
elif len(n) != 1 and len(n) % 2 == 1:
    ans = int(n) - 10 ** (len(n) - 1) + 1 + l[len(n) // 2 - 1]
else:
    ans =  l[len(n) // 2 - 1]

print(ans)

Solution (Python):
N=int(input())
ans=0
for i in range(1,N+1):
  if len(str(i)) in [1,3,5]:
    ans+=1
print(ans)

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

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

print(m)

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

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

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

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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
from math import log10

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())
    
    ans = 0
    for n in range(1, N+1):
        if int(log10(n)) % 2 == 0:
            ans += 1
    
    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict



sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)


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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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


if __name__ == '__main__':
    main()

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

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

print(cnt)

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

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

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

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

def digit(k):
    ret=0
    while k!=0:
        k//=10
        ret+=1
    return ret
    
for i in range(n):
    if digit(i+1)%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):
a = int(input())
ans = 0
for i in range(1, a + 1):
  if len(str(i)) % 2 ==1: ans+=1   
print(ans)

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

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

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n+1):
    if 0 < i < 10 or 99 < i < 1000 or 9999 < 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 != 0:
        ans += 1
print(ans)

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

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

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

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

print(ans)

Solution (Python):


s = int(input())
sum = 0

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

print(sum)

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()
l = len(N)
N_i = int(N)
ans = 0
 
p = int(l/2)
for i in range(p):
    q = i*2
    ans += 9 * (10**q)
 
if l%2 != 0:
    bottom = 10**(l-1)
    ans += N_i - bottom + 1
 
print(ans)

Solution (Python):
N = input()
l = len(N)
N_i = int(N)
ans = 0

p = int(l/2)
for i in range(p):
    q = i*2
    ans += 9 * (10**q)

if l%2 != 0:
    bottom = 10**(l-1)
    ans += N_i - bottom + 1

print(ans)

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

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

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

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

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

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

Solution (Python):
n=int(input())
res=9 if n >=9 else n
for i in range(3,len(str(n))+1):
  if i%2==0:
    continue
  res+=min(n+1,10**i)-10**(i-1)
print(res)

Solution (Python):
N = int(input())
count = 0
for i in range(1,N+1):
  len_i = len(str(i))
  if len_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!=0:
    ans+=1
print(ans)

Solution (Python):
import sys

[N] = [int(x) for x in sys.stdin.readline().strip().split(" ")]

result = 0

base = 1  
upper = 10  

while base <= N:
    _upper = min(upper, N + 1)
    result += _upper - base
    base *= 100
    upper *= 100

print(result)

Solution (Python):

def fn(i):
    return (1 <= i and i <= 9) or (100 <= i and i <= 999) or (10000 <= i and i <= 99999)


def main():
    n = int(input())
    x = range(n + 1)[1:]
    x = tuple(filter(fn, x))

    print(len(x))


if __name__ == '__main__':
    main()

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

    c = 0
    for i in range(n + 1)[1:]:
        if (1 <= i and i <= 9) or (100 <= i and i <= 999) or (10000 <= i and i <= 99999):
            c += 1

    print(c)


if __name__ == '__main__':
    main()

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

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

    print(c)


if __name__ == '__main__':
    main()

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

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

cnt = 0
for i in range(1, N+1):
    if int(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(9+n-99)
elif n<10000:
    print("909")
elif n<100000:
    print(909+n-9999)
elif n==100000:
    print("90909")

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

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


if __name__ == '__main__':
    solve()

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

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

print(ans)

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

if __name__ == '__main__':
    main()

Solution (Python):
n = input()

"""max(n) = 100000"""
if len(n) == 6:
  res = 9 + 900 + 90000
  print(res)
elif len(n) == 5:
  res = 9 + 900 + (int(n) -9999)
  print(res)
elif len(n) == 4:
  res = 9 + 900
  print(res)
elif len(n) == 3:
  res = 9 + (int(n) - 99)
  print(res)
elif len(n) == 2:
  res = 9
  print(res)
else:
  res = int(n)
  print(res)

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

print(c)

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

import sys
from sys import stdin

strN = stdin.readline().rstrip()
N = int(strN)
strLen = len(strN)

odd_count1 = 0
for i in range(1, strLen + 1):
    if i % 2 == 0:
        if i == strLen:
            print(odd_count1)
            sys.exit(0)
    else:
        if i == strLen:
            t1 = '1'
            t1 += '0' * (i - 1)
            t3 = N - int(t1) + 1
            odd_count1 += t3
            print(odd_count1)
            sys.exit(0)
        else:
            t1 = '1' + '0' * (i - 1)
            t2 = '9' * i
            odd_count1 += (int(t2) - int(t1)+1)

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

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

print(ans)

Solution (Python):
import sys
from itertools import combinations
import math


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


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

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 range(1, n+1):
    if len(str(i))==1 or len(str(i))==3 or len(str(i))==5:
        cnt += 1
print(cnt)

Solution (Python):

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

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

if len(str(N)) <= 1:
    answer = N
elif len(str(N)) <=2:
    answer = 9
elif len(str(N)) <=3:
    answer = 9 + N - 10**2 + 1
elif len(str(N)) <=4:
    answer = 9 + 9*10**2
elif len(str(N)) <= 5:
    answer = 9 + 9*10**2 + N - 10**4 + 1
else:
    answer = 9 + 9*10**2 + 9*10**4

print(answer)

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

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

Solution (Python):

n=int(input())
ans=0

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

print(ans)

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

print(count)

Solution (Python):
n = int(input())
N = str(n)
num = len(N)
ans = 0
if num == 1:
    ans += n
elif num == 2:
    ans += 9
elif num == 3:
    ans += 9
    ans += (n-100+1)
elif num == 4:
    ans += 9
    ans += 900
elif num == 5:
    ans += 909
    ans += (n-10000+1)
elif num == 6:
    ans += 90909
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
for i in range(1,n+1):
  if len(str(i)) % 2 != 0:
    ans += 1
 
print(ans)

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())
l = len(str(n))

if l == 1:
    print(n)
    exit()
ans = 9
if l % 2 == 1:
    ans += n + 1 - 10 ** (l - 1)

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

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

if l == 1:
    print(n)
    exit()
ans = 9
if l % 2 == 1:
    ans += n + 1 - 10 ** (l - 1)

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

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(N-90)
elif 1000<=N and N<=9999:
  print(909)
elif 10000<=N and N<=99999:
  print(N-90-9000)
else:
  print(90909)

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

Solution (Python):
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 = input()
N = list(n)
m = int(n)
if len(N) <= 2:
  if m >= 10:
    print(9)
  else:
    print(m)
    
elif 3 <= len(N) <= 4:
  if m >= 1000:
    print(9 + 900)
  else:
    print(9+m-99)
elif 5 <= len(N) <= 6:
  if m >= 100000:
    print(9 + 900 + 90000)
  else:
    print(9+ 900 + m - 9999)

Solution (Python):
def readinput():
    n=int(input())
    return n

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

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)

Solution (Python):
def readinput():
    n=int(input())
    return n

def main(n):
    if 1<=n and n<=9:
        return n
    elif 10<=n and n<=99:
        return 9
    elif 100<=n and n<=999:
        return 9+(n-99)
    elif 1000<=n and n<=9999:
        return 9+900
    elif 10000<=n and n<=99999:
        return 9+900+(n-9999)
    elif 100000==n:
        return 9+900+90000
    return 0

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)

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

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

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

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

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

print(count)

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


if n <= 9:
    print(n)
    exit()
if n > 9 and n <= 999:
    print(9 + max(n-99,0))
    exit()
if n > 999 and n <= 99999:
    print(9 + 900 + max(n-9999,0))
    exit()
if n > 99999 :
    print(9 + 900 + 90000)
    exit()

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

count = 0
num = 1
while N//num > 0:
    if num*10 <= N:
        count += num*9
    else:
        count += N%(num*10) - num + 1
    num *= 100

print(count)

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

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

print(res)

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

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())
for i in range(5,-1,-1):
  if n//10**i: break
if i:
  s=int('90'*((i-1)//2)+'9')
else: s=0
if i%2==0:
  s+=n-10**i+1
print(s)

Solution (Python):
n=int(input())
if n<10:
  print(n)
if 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 n==100000:
  print(90909)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

n = int(input())









l = [i for i in range(1,10)] + [i for i in range(100,1000)] + [i for i in range(10000,100000)] 

n = [i for i in range(1,n+1)]

ans = len(set(l) & set(n))

print(ans)

Solution (Python):
n = int(input())
count = 0
for i in range(n+1):
    hoge = i
    cnt = 0
    while hoge > 0:
        hoge //= 10
        cnt += 1
    if cnt % 2 != 0:
        count += 1
print(count)

Solution (Python):
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():

    N = int(input())

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

    print(ans)


if __name__ == '__main__':
    solve()

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

if N <= 9:
    ans=N
elif N<=99:
    ans=9
elif N<=999:
     ans=N-100+1+9
elif N<=9999:
    ans=999-100+1+9
elif N<=99999:
    ans=N-10000+1+999-100+1+9
else:
    ans=99999-10000+1+999-100+1+9

print(ans)

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

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

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

    
    

n = int(input())
print(actual(n))

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):
n = input()
a = len(n)  
if a % 2 == 0:  
  ans = "90" * (a // 2)
  ans = int(ans[:-1])
else:
  if a == 1:
    ans = int(n)
  else:
    ans = "90" * ((a - 1) // 2)
    ans = int(ans[:-1])
    ans += int(n) - 10 ** (a - 1) + 1
print(ans)

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

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

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

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

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

Solution (Python):
N=int(input())
count=0
for i in range(1,N+1):
	s = str(i)

	ll=len(s)
	if ll%2==1:
		count+=1
print(count)

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

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

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

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

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

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

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

print(ans)

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

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

Solution (Python):


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

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


for i in range(0, m):
  if i%2==1:
    cnt+=10**i-10**(i-1)
print(cnt)

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

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

print(count)

Solution (Python):
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n = int(input())

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

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()

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

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

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

Solution (Python):
import sys

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

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

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

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

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

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

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

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

Solution (Python):
N  = int(input())
def divisor(n):
    div_list = []
    for i in range(1, int(1+ n**0.5)):
        if n%i == 0 and i**2 == n:
            div_list.append(i)
        elif n%i == 0:
            div_list.append(i)
            div_list.append(int(n/i))
    return div_list
counter = 0

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

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

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

Solution (Python):
N = int(input())
num = 0
for i in range(6):
  if N >= 10**i and N < 10**(i+1):
    keta = i+1
if keta == 1:
  num = N
elif keta == 2:
  num = 9
elif keta == 3:
  num = 9 + N - 99
elif keta == 4:
  num = 909
elif keta == 5:
  num = 909 + N -9999
else:
  num = 90909
print(num)

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

Solution (Python):
def f(N):
    x=0
    for i in range(N+1):
        t=str(i)
        if len(t)%2==1:
            x+=1
    return x-1
N=int(input())
print(f(N))

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

print(b)

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
import math
for i in range(1,n+1):
  if (int(math.log10(i)))%2==0:
    ans=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
for i in range(1, n+1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

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

Solution (Python):


n = int(input())

ans = 0
for i in range((len(str(n))+1)//2):
    num = 10**(2*i)
    line = num*10-1
    
    
    

    if n-line >= 0:
        ans += num*9
    else:
        ans += n-num+1

print(ans)