Problem:
 Score : 200 points    Problem Statement Given is an integer N . Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).      Constraints  1 \leq N \leq 10^5         Input Input is given from Standard Input in the following format:  N       Output Print the number of positive integers less than or equal to N that have an odd number of digits.        Sample Input 1 11      Sample Output 1 9  Among the positive integers less than or equal to 11 , nine integers have an odd number of digits: 1, 2, \ldots, 9 .       Sample Input 2 136      Sample Output 2 46  In addition to 1, 2, \ldots, 9 , another 37 integers also have an odd number of digits: 100, 101, \ldots, 136 .       Sample Input 3 100000      Sample Output 3 90909

Solution (Python):
import math
N = int(input())
keta = math.floor(math.log10(N))+1
if keta<1:
  result = 0
elif keta == 1:
  result = N
elif keta == 2:
  result = 9
elif keta%2==1:
  result = 9
  a = (keta-2)//2
  for i in range(1,a+1):
    result += 9*10**(2*i)
  result += N - 10**(keta-1) + 1
else:
  result = 9
  a = (keta-2)//2
  for i in range(1,a+1):
    result += 9*10**(2*i)
print(result)

Solution (Python):




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


def process(n):
    first = n % 10
    second = (n - first) % 100
    third = (n - first - second) % 1000
    forth = (n - first - second - third) % 10000
    fifth = (n - first - second - third - forth) % 100000
    sixth = (n - first - second - third - forth - fifth) % 1000000
    if sixth != 0:
        return 9 + 900 + 90000
    if fifth != 0:
        return 9 + 900 + (n - 9999)
    if forth != 0:
        return 9 + 900
    if third != 0:
        return 9 + (n - 99)
    if second != 0:
        return 9
    if first != 0:
        return n


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
s=len(str(n))
c=0
for i in range(s-1):
    if i%2==0:
        c+=9*10**i
if s%2==1:
    c+=n-(10**(s-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 = input()
keta = len(n)
n = int(n)

count = 0
if keta == 1:
    count = (n-1+1)
elif keta == 2:
    count = (9-1+1)
elif keta == 3:
    count = (n-100+1) + (9-1+1)
elif keta == 4:
    count = (9-1+1) + (999-100+1)
elif keta == 5:
    count = (n-10000+1) + (9-1+1) + (999-100+1)
elif keta == 6:
    count = (9-1+1) + (999-100+1) + (99999-10000+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())
Nlen=len(str(N))

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

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

print len([j for j in xrange(1, 1+N) if len(str(j)) in [1, 3, 5]])

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

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

Solution (Python):

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

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

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

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

n = len(number) // 2
ans = 0
underNum = ''

if n == 0:
  ans = int(number[0])
else:
  ans = 9
  for i in range(3, len(number)+1):
    if i == len(number) and i % 2 != 0:
      if int(number[0]) == 1:
        for j in range(1, i):
          underNum += number[j]
        ans += int(underNum) + 1
      else:
        ans += (int(number[0]) - 1) * 100 ** (i // 2)
        for j in range(1, i):
          underNum += number[j]
        ans += int(underNum) + 1
    elif i % 2 != 0:
      ans += 9 * 100 ** (i // 2)
      
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):
print(sum([k-10**i if i%2==0 else 0 for i,k in enumerate(*[[int(N)+1 if i==0 else 10**(len(str(N))-i) for i in range(len(str(N)))][::-1] for N in [str(input())]])]) )

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 < 10:
    ans = N
elif N < 10 ** 2:
    ans = 9
elif N < 10 ** 3:
    ans = N - 10 ** 2 + 10
elif N < 10 ** 4:
    ans = 909
elif N < 10 ** 5:
    ans = N - 10 ** 4 + 910
else:
    ans = 90909
print(ans)

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

print(kekka)

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

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

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

Solution (Python):
def solve(string):
    base = int(string) if len(string) % 2 == 1 else 10**(len(string) - 1) - 1
    excepts = sum([9 * 10**(i - 1) for i in range(2, len(string), 2)])
    return str(base - excepts)


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

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

sum=0

if(len(strN)%2==1):
    sum+=N-10**(len(strN)-1)+1
    

for i in range(len(strN)-1,0,-1):
    
    if(i%2==1):
        sum+=10**(i-1)*9
        
if(len(strN)==1):
    sum=N

print(sum)

Solution (Python):

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

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

        







main()

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())
if N < 10:
    print(N)
if 10 <= N < 100:
    print(9)
if 100 <= N < 1000:
    print(N-90)
if 1000 <= N < 10000:
    print(909)
if 10000 <= N <100000:
    print(N-9090)
if N == 100000:
    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())
ans = 0
for i in range(1, n+1):
    if len(str(i)) % 2:
        ans += 1
    else:
        pass
print(ans)

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

if N <= 9:
    result = N
elif N <= 99:
    result = 9
elif N <= 999:
    result = N - 90
elif N <= 9999:
    result = 909
elif N <= 99999:
    result = N - 9090
elif N == 100000:
    result = 90909

print(result)

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

Solution (Python):


n=int(raw_input())
res=0
for i in xrange(1,n+1):
 if len(str(i))%2==1:
  res+=1
print res

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

Solution (Python):
import math

def count_uneven_digit(N):
    n_digits = int(math.log10(N) + 1)
    
    diffs = 0
    if n_digits%2 != 0:
        diffs = 9*10**(n_digits-1) - N + 10**(n_digits - 1) - 1
    
    num_uneven_digitnums = [9*10**i for i in range(n_digits) if i % 2 == 0]
    return sum(num_uneven_digitnums) - diffs
  
  
N = int(input())

print(count_uneven_digit(N))

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

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

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

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

print(res)

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):
l=[9,900,90000,900000]
n=int(input())
ld=len(str(n))
if ld==1:
  print(n)
elif ld==2:
  print(l[0])
elif ld==3:
  print(l[0]+(n-100)+1)
elif ld==4:
  print(l[0]+l[1])
elif ld==5:
  print(l[0]+l[1]+(n-10000)+1)
elif ld==6:
  print(l[0]+l[1]+l[2])

Solution (Python):
import math

n = int(input())

l = math.log10(n)

cnt = 0

if l < 1:
    print(n)
elif l < 2:
    print(9)
elif l < 3:
    print(9 + n - 99)
elif l < 4:
    print(9 + 999 - 99)
elif l < 5:
    print(9 + 999 - 99 + n - 9999)
else:
    print(9 +999 - 99 + 99999 - 9999)

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

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

Solution (Python):
n = int(input())
 
exp = 1000
expMin = 100
 
result = min(9, n)
while n >= exp - 1:
  result += (exp - expMin)
  expMin = exp * 10
  exp = exp * 100
  
remainder = n - (expMin - 1)
if remainder >= 0:
  result += remainder
  
print(result)

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 keta(x):
  keta=1
  while x//10!=0:
    keta+=1
    x=x//10
  return keta
N=int(input())
numbers=0
for i in range(1,N+1):
  if keta(i)%2==1:
    numbers+=1

print(numbers)

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

Solution (Python):
import math
import fractions
import copy
import numpy as np
def j(q):
    if q==1: print("YES")
    elif q == 0:print("NO")
    exit(0)
rem = pow(10,9)+7
"""
def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")
"""

def ip():
    return int(input())
def iprow():
    return [int(i) for i in input().split()]
def ips():
    return (int(i) for i in input().split())
def printrow(a):
    for i in a:
        print(i)
"""

def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
"""
n=ip()
s=0
for k in range(1,n+1):
    if len(str(k))%2:s+=1
print(s)

Solution (Python):
N = int(input())
ans = 0
if N >9:
    ans += 9
    if N > 99:
        if N > 999:
            ans += 900
            if N > 9999:
                if N > 99999:
                    ans += 90000
                else:
                  ans += N-9999
            else:
              pass   
        else:
          ans += N-99
    else:
      pass
else:
    ans += N
print(ans)

Solution (Python):
n = input()
if len(n) == 1:
    print(n)
elif len(n) == 2:
    print(9)
elif len(n) == 3:
    print((int(n) - 90))
elif len(n) == 4:
    print(909)
elif len(n) == 5:
    print((int(n) - 9090))
elif len(n) == 6:
    print(9 + 900 + 90000)

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

Solution (Python):



def count_digit(n: int) -> int:
    digit = 0

    while n:
        digit += 1
        n //= 10

    return digit


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

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):



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

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):

ans=0
num = int(input())

def div (num,n=0):
    if num<1:return n-1
    else:return div(num/10,n+1)

m=div(num)
mod = num-10**m+1
    
for i in range(m):
    if i%2==0: ans += 10**(i+1)-10**i
if m%2==0: ans+=mod

print(ans)

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


ttl=0
if len(str(n)) % 2 != 0:
    ttl+=(n - 10**(keta - 1)+1)
    

for i in [i for i in range(keta) if i % 2 != 0]:
    ttl+=(10**(i-1) * 9)

print(ttl)

Solution (Python):
if __name__ == "__main__":
    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)) in [1, 3, 5]:
        ans+=1
print(ans)

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time
sys.setrecursionlimit(10**7)
inf = 10**20

def oddDigit(x):
    s = str(x)
    return(len(s)%2 == 1)

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

b = [i for i in range(a) if len(str(i+1))%2!=0]

print(len(b))

Solution (Python):
N = int(input())
def f(a,count):
    a2 = 10**a
    if a2 <= N:
        if a % 2 == 1:
            count = count + a2 - (10**(a-1))
        return f(a+1,count)
    else:
        if a % 2 == 1:
            return count+ (N- (10**(a-1))) + 1
        else:
            return count
print(f(1,0))

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

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

for i in range(1,N+1):
    N_str = str(i)
    N_list = []
    for k in N_str:
        N_list.append(k)
    if len(N_list)%2 == 1:
        cnt += 1

print(cnt)

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

if n < 10:
    print(n)

elif n < 100:
    print(9)

elif n < 1000:
    print(n - 90)

elif n < 10000:
    print(909)

elif n < 100000:
    print(n - 9090)

else:
    print(90909)

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

Solution (Python):

import sys


def solve(N: int):
    print(sum([True 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))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
d = len(str(n))
a = [9, 0, 900, 0, 9000]
c = 0
for i in range(1, d):
  if i % 2 == 1:
  	c += 9 * (10**(i-1))
  
if d == 1:
  c += n
else:
  c += n - int('9'*(d-1)) if d % 2 == 1 else 0

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

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

Solution (Python):
import math

in1 = input()
t = math.log(int(in1),10)
t2 = math.floor(t)
t3 = math.ceil(t2/2)

ii = 0
sum = 0
for i,t in enumerate(range(t3)):
    c = 9*(10**ii)
    ii += 2    
    sum += c

t4 = int(in1) - 10**t2 + 1 if t2%2 == 0 else 0

print("{}".format(sum+t4))

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

def keta(N):
    ten = 1
    for i in range(1, 8):
        if N/ten < 1:
            break
        ten = ten*10
    return i-1
        
if keta(N)==1:
    ans = N
elif keta(N)==2:
    ans = 9
elif keta(N)==3:
    ans = 9 + N-99
elif keta(N)==4:
    ans = 909
elif keta(N)==5:
    ans = 909 + N-9999
elif keta(N)==6:
    ans = 90909

print(ans)

Solution (Python):


n = int(input())

ans = 0
for x in range(1, n+1):
    keta = len(str(x))
    if keta % 2 != 0:
        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):
num = int(input())
num_digit = len(str(num))

if num_digit == 1:
    print(num)
elif num_digit == 2:
    print(9)
elif num_digit == 3:
    print(9 + (num - 100 + 1))
elif num_digit == 4:
    print(909)
elif num_digit == 5:
    print(909 + (num - 10000 + 1))
elif num_digit == 6:
    print(90909)

Solution (Python):
import math

n = int(input())
ans = sum(1 for i in range(1, n + 1) if (math.floor(math.log10(i)) + 1) % 2 != 0)
print(ans)

Solution (Python):
N = int(input())
print(len(list(filter(lambda x: len(str(x)) % 2 == 1, range(1, N + 1)))))

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) 

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

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

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

print(ans)

Solution (Python):
n = input()

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

print(cnt)

Solution (Python):
N=int(input())
if N>9:
    if N>99:
        if N>999:
            if N>9999:
                if N>99999:
                    print(90909)
                else:
                    print(909+N-9999)
            else:
                print(909)
        else:
            print(9+N-99)
    else:
        print(9)
else:
    print(N)

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

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

if len(N) <= 1:
	print(n)
elif len(N) <= 2:
	print(9)
elif len(N) <= 3:
	print(9+n-99)
elif len(N) <= 4:
	print(9+999-99)
elif len(N) <= 5:
	print(9+999-99+n-9999)
else:
	print(90909)

Solution (Python):

N = int(input())


count = 0


for i in range(1, N + 1):
    if len(str(i)) % 2 != 0:
        count = count + 1
        
print("{}".format(count))

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

counter = 0

if a < 10:
  counter = a
elif a < 100:
  counter = 9
elif a < 1000:
  counter = 9 + (a -99)
elif a < 10000:
  counter =  909
elif a < 100000:
  counter = 909 + (a - 9999)
elif a == 100000:
  counter = 90909

print(counter)

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

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

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

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

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


list_n = list(range(1,n+1))



cnt = 0
for i in list_n:
     if (len(str(i)))%2 == 1:
            cnt += 1
     else: pass
print(cnt)

Solution (Python):


N = int(input())
counter =0

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

print(counter-1)

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

n, count = 10, 0
while N >= n:
  count += n - n // 10
  n *= 100
if N >= n // 10:
  count += N - n // 10 + 1
print(count)

Solution (Python):
def q54(n):
    
    a = filter(lambda x: x != 0, [len(str(i))%2 for i in range(1, n+1)])
    print(len(list(a)))

N = int(input())
q54(N)

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

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

print(ans)

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

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

Solution (Python):
n=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())
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(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):
    if len(str(i))%2==1:
        cnt+=1
print(cnt)

Solution (Python):
a = int(input())
 
sum=0
i=0
 
while i<len(str(a)):
	if i==int(len(str(a)))-1:
		sum=sum+a-10**i+1
	else:
		sum=sum+10**(i+1)-10**(i)
	
	i=i+2
print(sum)

Solution (Python):
import sys

N = int(sys.stdin.readline().rstrip())
counter=0
if N >= 10:
  counter+=9
else:
  counter+=N
  print(counter)
  exit()

if N < 100:
  print(counter)
  exit()
  
if N >= 1000:
  counter+=900
else:
  counter+=N-99
  print(counter)
  exit()
  
if N < 10000:
  print(counter)
  exit()
  
if N >= 100000:
  counter+=90000
else:
  counter+=N-9999
  
print(counter)

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

Solution (Python):

i = input()
n = len(i)
ans = 0
for j in range(n + 1):
  if j == n and j % 2 == 1 and j == 1:
    ans += int(i)
  elif j == n and j % 2 == 1:
    ans += int(i) - int(str(9) * (j - 1))
  elif j == 1:
    ans += 9
  elif j % 2 == 1:
    ans += 10 ** j - int(str(9) * (j - 1)) - 1
print(ans)

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

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

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

Solution (Python):
N = int(input())
str_N = str(N)
if len(str_N)%2 == 0:
  N = 10 ** (len(str_N))-1
k = len(str_N)//2
ans2 = 0
for i in range(k):
  ans2 = ans2 + 10 ** (2*i+1) - 10 **(2*i)
ans2 += N - (10**(2*k) -1)
print(ans2)

Solution (Python):
"""
 // Author : snape_here - Susanta Mukherjee
 // Date : 27/07/2019

"""
from __future__ import division, print_function
import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    _str = str
    str = lambda x=b"": x if type(x) is bytes else _str(x).encode()

    


from math import ceil,floor,log,sqrt,factorial,pow,pi






  



def ii(): return int(input())
def fi(): return float(input())
def si(): return str(input())
def mi(): return map(int,input().split())
def li(): return list(mi())

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



BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        if self.buffer.tell():
            return self.buffer.read()
        return os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", b" "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", b"\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip(b"\r\n")



if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
N=int(input())
dig=len(str(N))
digr=dig-(dig%2)-2
intr=sum([10**i for i in range(0, digr+1,2)])*9
if (dig % 2):
    intr=intr+N-10**(dig-1)+1

print(intr)

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 n in range(1, N + 1):
    tmp = str(n)
    if len(tmp) % 2 == 1:
        count += 1
print(count)

Solution (Python):
import sys, math, itertools, bisect, copy, re
from collections import Counter, deque, defaultdict






INF = float('inf')
MOD = 10 ** 9 + 7
EPS = 10 ** -7
sys.setrecursionlimit(1000000)








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())
a = 90000*(bool(N//100000))
b = 900*(bool(N//1000))
c = 9*(bool(N//10))
d = (N-99)*(bool(N//100)-bool(N//1000))
e = (N-9999)*(bool(N//10000)-bool(N//100000))
f = N*(1-bool(N//10))
print(a+b+c+d+e+f)

Solution (Python):
from heapq import heappush, heappop
from collections import deque
import itertools
from itertools import permutations
import sys
import bisect
sys.setrecursionlimit(10**6)
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
YNeos='YNeos'
GYN=['Yes','trumpet']
mo=10**9+7
imp='IMPOSSIBLE'


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

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

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

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

for i in range(1, N+1):
	if len([x for x in 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):
p = 10
N = int(input())
r = 0
while N>=p**(2*r):
    r += 1
r -= 1
if N < p**(2*r+1):
    print(N-p**(2*r) + 1 + (p**(2*r)-1)//(p+1))
else:
    print((p**(2*(r+1))-1)//(p+1))

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




REL_PATH = 'ABC\\136\\B'


TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            return self.problem[self.index]
            self.index += 1
        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                self.initialize(path)
                self.resolve()
        except NameError:
            self.resolve()


class B(Common):

    def resolve(self):

        n = int(self.input_data())
        digits = len(str(n))
        result = 0
        if digits % 2 != 0:
            result += n - (10 ** (digits-1)) + 1
        for i in range(1, digits):
            if i % 2 == 0:
                continue
            else:
                result += 10 ** (i-1) * 9

        print(str(result))



solver = B(REL_PATH)
solver.exec_resolve()

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

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())
if n==10**5:
    print('90909')
elif n >= 10000:
    print(str(910 + n-10000))
elif n >= 1000:
    print('909')
elif n >= 100:
    print(str(10 + n-100))
elif n >= 10:
    print('9')
else:
    print(str(n))

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

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

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

print(cnt)

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())
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 != 0:
        ans += 1

print(ans)

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

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