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

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
  s = str(i)
  if len(s) % 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):
def resolve():
    import math
    n = int(input())
    ans = 0
    for i in range(1, n+1):
        test = len(str(i))
        if test % 2 == 1:
            ans += 1
    print(ans)
resolve()

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

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

print(count)

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())
m = len(str(N))

ans = 0
if m > 1:
    for i in range(0, m - 1, 2):
        ans += 9 * (10 ** i)

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

print(ans)

Solution (Python):

n = int(input())
s = str(n)
l = len(s)

cnt = 0

for i in range(1,l+1):
    s = str(n)
    l = len(s)
    if i % 2 == 1:
        if n < 10:
            cnt += n
            break
        elif i == 1:
            cnt += 9
            
        elif n < 10**i:
            cnt += n - 10**(i-1) + 1
            
            
        else:
            cnt += 10**(i) - 10**(i-1)
print(cnt)

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

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

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

Solution (Python):
num = int(input())
lst = []
count = 0
for i in range(1, num+1):
  while i > 0:
    lst.append(i%10)
    i //= 10
  if len(lst) % 2 == 1:
    count += 1
  lst = []
print(count)

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

if (n >= 1) and (n <= 8):
    print(n)
elif (n >= 9) and (n <= 99):
    print(9)
elif (n >= 100) and (n <= 998):
    print(n - 90)
elif (n >= 999) and (n <= 9999):
    print(909)
elif (n >= 10000) and (n <= 99998):
    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 != 0:
        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())

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

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

print(counter)

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

ans = 0
for i in range(1,keta,2):
	ans += 9 * (10 ** (i-1))

if keta % 2 == 0:
	print(ans)
else:
	ans += n - 10**(keta-1) + 1
	print(ans)

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

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

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

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

'''
if len(str(n)) % 2 == 1:
    print("yas")
else :
    print("no")
'''
for i in range(1,n+1):
    if len(str(i))%2==1:
        count += 1
print(count)

Solution (Python):
import sys


def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

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

def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

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

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

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

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

Solution (Python):
import math
def digits(n):
  return int(math.log10(n))+1
  
def main():
  n = int(input())
  n_digit = digits(n)
  ans = 0
  
  if n_digit%2==0:
    for i in range(n_digit-1,0,-2):
      ans = ans + (pow(10,i)-pow(10,i-1))  
  else:
    ans = n - pow(10,n_digit-1) + 1
    for i in range(n_digit-2,0,-2):
      ans = ans + (pow(10,i)-pow(10,i-1)) 
  print(ans)
    
  
if __name__ == "__main__":
  main()

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

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

print(ans)

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

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

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

N=int(input())
c=0
for i in range(1,N+1):
    if(0<i<10 or 99<i<10**3 or (10**4-1)<i<10**5):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):
a = 0
for i in range(1,int(input())+1):
    if len(str(i))%2==1:
        a += 1
print(a)

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 int(len(str(i))) % 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 == 1:
        cnt += 1

print(cnt)

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

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

print(ans)

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

ans = 0

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

print(ans)

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

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

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

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

if digit % 2 == 1:
    cnt += n - 10**(digit - 1) + 1
    
print(cnt)

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

Solution (Python):
def q2():
    """ B - Uneven Numbers """
    N = int(input())
    keta = 1
    d = N
    while True:
        d, _ = divmod(d, 10)
        if d > 0:
            keta += 1
        else:
            break

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


if __name__ == '__main__':
    q2()

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

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


for i in range(n+1):
    lst =[]
    while i >0:
        lst.append(i%10)
        i //=10
    lst.reverse()
    if len(lst)%2 ==1:
        count += 1

print(count)

Solution (Python):
import numpy as np
a = len([n for n in range(1,int(input())+1) if ((np.log10(n)+1)//1)%2!=0])
print(a)

Solution (Python):
n = int(input())
ans = 0
if n < 10:
  ans += n
else:
  ans += 9
  if n < 1000:
    ans += max(0, n-99)
  else:
    ans += 900
    if n < 100000:
      ans += max(0, n-9999)
    else:
      ans += 90000
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
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

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

Solution (Python):

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

import math
n = int(readline())
count = 0
for i in range(1, n + 1):
    if int(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 += 1
print(ans)

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

answer = 0
number_of_digits = len(str(N))

total = 0
for nth in range(1, number_of_digits + 1):
    is_odd = nth % 2 is 1
    if not is_odd: continue
    number_of_intergers = (10 ** ((nth - 1))) * 9
    total += number_of_intergers

    if 10 ** nth -1 >= N:
        total -= 10 ** number_of_digits - 1 - N

print(total)

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

cnt = 0

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

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

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

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

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

Solution (Python):
N = int(input())
i = 1
r = 0
while i <= N:
    if len(str(i)) % 2 == 1:
        r += 1
    i += 1
print(r)

Solution (Python):
a= int(input())
result = 0
for i in range(10):
    if a >= 10 ** (i-1) and a < 10 ** i :
        rank = i 
        break

for i in range(rank+1):
    
    if i == 1 and rank is not i:
        result += 10 ** i -1
    elif i == 3 and rank is not i:
        result += 10 ** i  - 10** (i-1)
    elif i == 5 and rank is not i:
        result += 10 ** i  - 10** (i-1)
    elif i == rank and i %2 is not 0:
        result += a - 10 ** (i-1) + 1
    
        
        
print(result)

Solution (Python):










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




""" 
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())
print(len(list(i for i in range(1, n+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 != 0:
        ans += 1
print(ans)

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

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

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

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










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
  
def main():
  N = input()
  ans = 0
  if len(N) == 6:
    ans += 10**5 - 10**4
    ans += 10**3 - 10**2
    ans += 10**1 - 10**0
  elif len(N) == 5:
    ans += int(N) - 10**4 + 1
    ans += 10**3 - 10**2
    ans += 10**1 - 10**0
  elif len(N) == 4:
    ans += 10**3 - 10**2
    ans += 10**1 - 10**0
  elif len(N) == 3:
    ans += int(N) - 10**2 + 1
    ans += 10**1 - 10**0
  elif len(N) == 2:
    ans += 10**1 - 10**0
  elif len(N) == 1:
    ans += int(N)
  print(ans)
if __name__ == '__main__':
  main()

Solution (Python):
n=int(input())
ans=0
while n>0:
  l=len(str(n))
  if l%2==0:
    n=10**(l-1)-1
  l=len(str(n))
  if l==1:
    ans+=n
  else:
    chk=int(str(n)[0])
    ans+=n-(10**(l-1)-1)
  if l>0:
    n=10**(l-2)-1
print(ans)

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

for i in range(N):
    S = list(str(i + 1))
    if len(S) % 2 == 1:
        count += 1
    else:
        continue

print(count)

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

keta = int(math.log10(N)+1)
count = 0
for i in range(1,keta+1):
    if i % 2 == 1:
        if i == 1:
            if keta == 1:
                count += N
            else:
                count += 9
        elif i != keta:
            count += int('8'+'9'*(i-1)) + 1
        else:
            count += N - 10 ** (keta-1) + 1
print(count)

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

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


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


if __name__ == '__main__':
    n =input()
    sum = 0
    for i in range(1,len(n)+1):
        if i %2 >0:
            if i ==len(n):
                sum +=  int(n)- 10**(i-1)+1
            else:
                sum += 9 * (10**(i-1))

    print(sum)

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

print(cnt)

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

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

if u % 2 == 0:
    print((100**(u//2)-1)//11)
elif u % 2 == 1:
    print((100**((u-1)//2)-1)//11 + n - 10**(u-1) + 1)

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

Solution (Python):
import math

N = int(input())

i=0
num=0


while 10**i <= N:
  i=i+1
    


if i==1:
  num=N
elif i==2:
  num=9
elif i==3:
  num=9+N-99
elif i==4:  
  num=9+999-99
elif i==5:  
  num=9+900+N-9999
elif i==6:  
  num=9+900+99999-9999
  
print(num)

Solution (Python):
N = input()
Nlist = list(N)
NN = int(N)
count = 0
for a in Nlist:
  count += 1




if count == 1:
  print(int(NN))
if count == 2:
  print(9)
if count == 3:
  print(int(NN) - 90)
if count == 4:
  print(909)
if count == 5:
  print(int(NN) -9090)
if count == 6:
  print(90909)

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

x = 0

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

print(x)

Solution (Python):
n = int(input())
print(min(9, n) + max(0, min(999, n) - 99) + max(0, min(99999, n) - 9999))

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

for n in range(1, len(Ns)):
    if n % 2 == 0:
        continue
    count += 10 ** n - 10 ** (n - 1)

if len(Ns) % 2 == 1:
    count += N - 10 ** (len(Ns) - 1) + 1

print(count)

Solution (Python):
n = int(input())
idx = 1
total = 0
tmp = n
while (tmp > 0): 
	if idx == len(str(n)):
		if idx % 2 == 1:
			total += (tmp - 1) * 10 ** (idx - 1)
			total += n % (10 ** (idx - 1)) + 1
	else:
		if idx % 2 == 1:
			total += 9 * 10 ** (idx - 1)
	tmp = int(tmp / 10)
	idx += 1
print (total)

Solution (Python):
s = input()
N = int(s)
odd_num = 0
for i in range(1,N+1):
    cnt = 1
    num = i
    while (num // 10) > 0:
        cnt += 1
        num = num//10
    if cnt % 2:
        odd_num += 1
print(odd_num)

Solution (Python):
import os, sys, re, math

N = int(input())

if N < 10:
    print(N)
elif N < 100:
    print(9)
elif N < 1000:
    print(N - 100 + 10)
elif N < 10000:
    print(999 - 100 + 10)
elif N < 100000:
    print(N - 10000 + (1000 - 100 + 10))
else:
    print(99999 - 10000 + (1000 - 100 + 10))

Solution (Python):

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

Solution (Python):
print(sum([len(str(i)) % 2 == 1 for i in range(1, int(input()) + 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):
n = int(input())
a = 0
for i in range(1,n+1):
    if len(str(i))%2 != 0:
        a += 1
print(a)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    ct=0
    for i in range(1,n+1):
        if len(str(i))%2==1:
            ct+=1
    print(ct)
if __name__ == '__main__':
    do()

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

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

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

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

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

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

print(cnt)

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):
N=input()
l=len(N)
ans=0
if l%2==1:
    for i in range(1,l,2):
        ans+=9*10**(i-1)
    print(ans+1+int(N)-10**(l-1))
else:
    for i in range(1,l,2):
        ans+=9*(10**(i-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())
ans=0
ans+=9 if n>=10 else n
ans+=900 if n>=1000 else max(n-99,0)
ans+=90000 if n>=100000 else max(n-9999,0)
print(ans)

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

ans = 0
for i in range(1,digit+1):
    if i%2 == 1:
        if i == digit:
            if  i == 1:
                ans += n
            else:
                ans += n-int('9'*(i-1))
        else:
            ans += 9*10**(i-1)
print(ans)

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

Solution (Python):

import sys


def solve(N: int):
    return sum(1 for i in range(1, N+1) if len(str(i)) % 2 == 1)



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

if __name__ == '__main__':
    main()

Solution (Python):

GBN_DEBUG = False
def dprn(s, i):
    if GBN_DEBUG: print(", " + s + " = " + str(i), end = "")
def dprns(s):
    if GBN_DEBUG: print(", " + s, end = "")
def dprni(i):
    if GBN_DEBUG: print(i, end=" ")
def endl(): 
    if GBN_DEBUG: print('')
def puts(s): print(s)




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 = int(input())
ans = 0
m = n
x = 1

while m >= 10: 
  m = m / 10
  x = x + 1

for i in range(1,x+1):
  if i == x and i%2 == 1: 
    ans = ans + n - 10**(i-1) + 1
  elif i%2 == 0: 
      continue
  else: 
    ans = ans + 9 * 10**(i-1)

print(ans)

Solution (Python):
import math
import copy
from copy import deepcopy
import sys
import fractions

from functools import reduce

import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)







def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList




n = int(input())

ans = 0
for i in range(1, n + 1, 1):
    s = str(i)
    if len(s) % 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-9999+909)
else:
    print(90909)

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

Solution (Python):
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 math

def dig(n):
    return math.floor(math.log10(n))+1

ans = 0
for i in range(int(input())):
    ans += (dig(i+1) % 2 == 1)
print(ans)

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

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

Solution (Python):
N = int(input())
a=0
cnt = 0
num = N
while 10<=num:
  num/=10;a+=1
if a%2==0:
  for i in range(10**a,N+1):
    cnt += 1
if 4 < a:
  print(cnt + 90909)
elif 2 < a:
  print(cnt + 909)
elif 0 < a:
  print(cnt + 9)
else:
  print(cnt)

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

Solution (Python):
N=int(input())
count=0
def check():
    global count
    if N>=9:
        count+=9
    else:
        count+=N
        return None

    if N>=999:
        count+=999-100+1
    elif N>=100:
        count+=N-100+1
        return None

    if N>=99999:
        count+=99999-10000+1
    elif N>=10000:
        count+=N-10000+1
        return None
check()
print(count)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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):
N = int(input())
if N <= 9:
  print(N)
elif 10 <= N <= 99:
  print(9)
elif 100 <= N <= 999:
  print(N-90)
elif 1000 <= N <= 9999:
  print(909)
elif 10000 <= N <= 99999:
  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 == 0:
    continue
  else:
    count += 1
    
print(count)

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

N = i_i()

l = len(str(N))

if l == 1 or l == 2:
    print(min(9, N))
elif l == 3 or l == 4:
    print(min(9 + N - 100 + 1, 909))
else:
    print(min(9 + 900 + N - 10000 + 1, 90909))

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

if d % 2 == 1:
  ans = (100 ** ((d-1)//2) - 1) // 11 + (n - 10**(d-1) + 1)
else:
  ans = (100**(d//2) - 1) // 11
  
print(ans)

Solution (Python):

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

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

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

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

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

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

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

print(ans)

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

if n == 100000:
    ans = 90000 + 900 + 9
elif n >= 10000:
    ans = n - 9999 + 900 + 9
elif n >= 1000:
    ans = 900 + 9
elif n >= 100:
    ans = n - 99 + 9
elif n >= 10:
    ans = 9
else:
    ans = n

print(ans)

Solution (Python):
n=int(input())
ans=0
for i in range(1,n+1):
    x=str(i)
    if len(x)%2:
        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())
print(sum(len(str(i)) % 2 for i in range(1, n + 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())
ans = 0
for i in range(1,n+1):
    if len(str(i)) % 2 == 1:
        ans += 1
        
print(ans)

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

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

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)

if __name__ == "__main__":
    main()

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

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

print(ans)

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

Solution (Python):
n = int(input())
l = len(str(n))
res = 0
if l%2 != 0 :
    res = n+1-10**(l-1)
    while l >= 1:
        l -= 2
        res += 10**(l-1)*9
if l%2 == 0:
    l -= 1
    while l >= 1:
        res += 10**(l-1)*9
        l -= 2
print(int(res))

Solution (Python):
import math
import os
import random
import re
import sys

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

    res = math.ceil(math.log(n, 10))
    s = 1 if math.log(n, 10) % 2 == 0 else 0

    for i in range(0, res, 2):
        k = 10**(i + 1) - 1
        if n > k:
            s = s + 9 * (10 ** i)
        else:
            s = s + n - 10**i + 1
    
    print(s)

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

Solution (Python):
n=int(input())
k=len(str(n))
if k==1 or k==2:
    print(min(9,n))
elif k==3 or k==4:
    print(min(9+n-99,909))
else:
    print(min(909+n-9999,90909))

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

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

print(count)

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

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

print(res)

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

if __name__ == "__main__":
    resolve()

Solution (Python):
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()

def F(x):
    return (len(str(x)) % 2) == 1
answer = 0
for i in range(1, N+1):
    if F(i):
        answer += 1

print(answer)

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

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

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(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())
li = range(1, n+1, 1)
count = 0
for i in range(len(li)):
    if 1 <= li[i] <= 9 or 100 <= li[i] <= 999 or 10000 <= li[i] <= 99999:
        count += 1
print(count)

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

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

print(count)

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

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

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

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