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=len(str(n))
ans=0
if l>=4:
    if l==6:
        ans+=100000-10000
    elif l==5:
        ans+=n+1-10000
    ans+=1000-100
    ans+=10-1
elif l>=2:
    if l==3:
        ans+=n+1-100
    ans+=10-1
else:
    ans+=n   
print(ans)

Solution (Python):

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

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):
res = 0
for i in xrange(1,input()+1):
    if len(str(i)) %2 != 0 :
        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())

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<1000:
  print(9+max(0,n-99))
elif n<100000:
  print(9+900+max(0,n-9999))
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())
ans=0
for i in range(1,N+1):
    if len(str(i))%2==1:
        ans=ans+1
print(ans)

Solution (Python):


N = int(input().strip())


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

print(cnt)

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

s = 0
for i in range(1, d):
    s += 9 * 10 ** (i - 1) if i % 2 else 0
s += int(n) - 10 ** (d - 1) + 1 if d % 2 else 0

print(s)

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

res = 0
if 1<= N <= 9:
  res = N
elif N <= 99:
  res = 9
elif N <= 999:
  res = 9 + (N-99)
elif N <= 9999:
  res = 9 + 900
elif N <= 99999:
  res = 9 + 900 + (N-9999)
else:
  res = 9 + 900 + 90000

print(res)

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

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

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

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

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

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

print(sum(len(str(i)) % 2 for i in range(1,N+1)))

Solution (Python):

"""
B - Uneven Numbers
https://atcoder.jp/contests/abc136/tasks/abc136_b

"""
import sys


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


def main(args):
    N = int(input())
    ans = solve(N)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

Solution (Python):
N = int(input())
na = len(str(N))
if na == 1:
    print(N)
if na == 2:
    print(9)
if na == 3:
    print(9+N-99)
if na == 4:
    print(909)
if na == 5:
    print(909+N-9999)
if na == 6:
    print(90909)

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

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

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

N = int(input())
ans = 0

for i in range(1, N+1):
    d = int(math.log10(i))+1
    if d % 2 == 1:
        ans += 1
print(ans)

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

print(solve())

Solution (Python):
n=input();k=len(n)
print(sum(9*10**~-i for i in range(k) if i%2)-(10**~-k-int(n)-1)*(k%2))

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

Solution (Python):
n = int(input())
digit_list = []
cnt = 0

for i in range(1, n+1):
    digit_list.append(len(str(i)))

for i in digit_list:
    if i % 2 == 1:
        cnt += 1

print(cnt)

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

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

print(cnt)

Solution (Python):
N = int(input())
cnt = 0
num = 1
while num <= N:
    cnt += 1
    num += 1
    if len(str(num)) % 2 == 0:
        num *= 10
print(cnt)

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

Solution (Python):
n = int(input())
print(sum(len(str(i)) % 2 == 1 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
i = 0
while 10 ** (i + 1) <= N:
    i += 1

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

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

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

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

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

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

Solution (Python):
from math import log10
n =int(input())
print(len([i for i in range(1, n+1) if int(log10(i)+1) % 2 != 0 and i <= n]))

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

def keta(n):
    count = 0
    while n != 0:
        n = n//10
        count+=1
    return count

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

Solution (Python):
def f(n):
	keta = 0
	while n:
		keta += 1
		n //= 10
	return keta % 2 == 1

N = int(input())
ans = 0
for i in range(1, N+1):
	if f(i):
		ans += 1
print(ans)

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

Solution (Python):
n = input()
count = 0
for digit in range(1, len(n)):
  if digit & 1:
    count += 10 ** digit - 10 ** (digit - 1)
if len(n) & 1:
  count += int(n) - 10 ** (len(n) - 1) + 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())
ans = 0
for i in range(1,N+1):
    if len(str(i))%2==0:
        pass
    else:
        ans += 1
print(ans)

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

ans = 0

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

print(ans)

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

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

print(sumans)

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

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

Solution (Python):
n=int(input())
ans=[int('9'+'0'*i) for i in range(0,8,2)]
p=len(str(n))
if len(str(n))&1==0:
    print(sum(ans[:p//2]))
else:
    print(sum(ans[:p//2])+(n+1-int('1'+'0'*(p-1))))

Solution (Python):
n=int(input())
ans=[int('9'+'0'*i) for i in range(0,8,2)]
p=len(str(n))
if len(str(n))&1==0:
    print(sum(ans[:p//2]))
else:
    print(sum(ans[:p//2])+(n+1-int('1'+'0'*(p-1))))

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

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    c = 0
    for i in range(1, n+1):
        if len(str(i)) % 2 == 0:
            continue
        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 math
import itertools
import sys
import copy

 







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


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

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

Solution (Python):

n=int(input())
print(sum([len(str(i))%2==1 for i in range(1,n+1)]))

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

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

l = [len(str(n)) % 2 == 1 for n in range(1, N+1)]
print(sum(l))

Solution (Python):
N = int(input())
count, n1, n2 = 0, 1, 9
while n1 <= N:
    if n2 <= N:
        count += n1 * 9
    else:
        count += (N - n1 + 1)
    n1, n2 = n1 * 100, n1 * 1000 - 1
print(count)

Solution (Python):
import sys
import math
'''a,b= map(int,input().split())'''


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

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

ans = 0
for i in range(1, n + 1):
    num = i
    digits = 0
    while num:
        digits += 1
        num //= 10
    if digits % 2 == 1:
        ans += 1

print(ans)

Solution (Python):
import sys
import math
'''a,b= map(int,input().split())'''


a=int(input())
count=0
for i in range(1,1+a):
  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 = input()

odd_list = [i for i in range(len(N)) if i % 2 == 1]
count = 0
for i in range(len(odd_list)):
    count += 10**int(odd_list[i])-10**int(odd_list[i]-1)
if len(N) % 2 == 1:
    count += int(N)+1-10**(len(N)-1)

print(int(count))

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

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

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

n = int(stdin.readline().rstrip())
l = [x for x in range(1, n + 1)]

print(len([i for i in l if len(str(i)) % 2 != 0]))

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

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

Solution (Python):

n = int(input())

cnt = 0

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

Solution (Python):
import sys

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

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

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

print(total)

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
l=n
while l>0:
    l=l//10
    c+=1

def f(p):
    return 10**(p-1)*9

ans=0
if c==1:
    print(n)
elif c%2==0:
    for i in range(1,c,2):
        ans+=f(i)
    print(ans)
else:
    ans+=n
    for i in range(2,c,2):
        ans-=f(i)
    print(ans)

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

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

print(count-1)

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 sys

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

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

Solution (Python):
import sys

import numpy as np
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
"""dd = [(-1, 0), (0, 1), (1, 0), (0, -1)];
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)];
ddn9 = ddn + [(0, 0)]
for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""

def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]  
def ws(): return sys.stdin.readline().split()
def si(): return int(sys.stdin.readline())  
def ss(): return input()
def hi(n): return [si() for _ in range(n)]
def hs(n): return [ss() for _ in range(n)]  
def s_list(): return list(input())
def mi(n): return [wi() for _ in range(n)]  
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]  
def grid(n): return [s_list() for _ in range(n)]


def main():
    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__':
    main()

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

if 1<=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):
input_string = input()
length = len(input_string)
n = int(input_string)

ans = 0

def func(i):
    a = '9'*i
    b = '1' + '0'*(i-1)
    A = int(a)
    B = int(b)

    if A > n:
        A = n

    return A - B + 1

ans = n
for i in range(0, length+1, 2):
    if i == 0:
        continue
    ans -= func(i)
print(ans)

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

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

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

if 1 <= n and n <= 99:
    ans = min(n, 9)
elif 100 <= n and n <= 9999:
    ans = min(n-90, 909)
else:
    ans = min(n-9090, 90909)

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(list(str(i)))%2 == 1:
        ans += 1

print(ans)

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

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

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
num = []

for i in range(N):
  num.append(i+1)
  
for j in range(len(num)):
  if len(str(num[j])) % 2 ==1:
    ans +=1
  else:
    continue
    
    
print(ans)

Solution (Python):
N = int(input())
cnt = 0
if 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(99999-9999+909)

Solution (Python):
def digit_sum(n):
    
    
    ans = 0
    while n > 0:
        ans += 1
        n //= 10
    return ans

n = int(input())
cnt = 0

for i in range(1, n+1):
    cnt += digit_sum(i) % 2

print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





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


if __name__ == "__main__":
    main()

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

N=int(input())

digits=len(str(N))
cnt=-(-digits//2)



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

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

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

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(n):
    if len(str(i+1))%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())
ans=0
i=10
for i in range(1,4):
    buf=2*i-1
    if n>=10**buf:
        ans+=9*10**(buf-1)
    else:
        ans+=max(0,n-10**(buf-1)+1)
        break
print(ans)

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

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

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

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

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

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


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

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

for i in range(1,num+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())
NT=N
cnt=0
ans=0
while NT//10:
  cnt+=1
  NT//=10
if cnt==0:
  ans=N
if cnt==1:
  ans=9
if cnt==2:
  ans=N-90
if cnt==3:
  ans=909
if cnt==4:
  ans=909+(N-9999)
if cnt==5:
  ans=90909
print(ans)

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

Solution (Python):
import numpy as np

N = int(input())

digit_max = len(str(N))

if digit_max ==2:
    ans =9
elif digit_max ==1:
    ans = N
elif digit_max >2:
    count=0
    for i in range(int(np.ceil(digit_max/2)-1)):
        j = 2*i+1
        count+=9*10**(j-1)
    if digit_max%2 ==1:
        count+=N-10**(digit_max-1)+1
    elif digit_max%2 ==0:   
        count+=9*10**(digit_max-2)
        
    ans = count
    
print(ans)

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

N = int(input())
ans = 0
if N < 10:
  ans = N
elif N < 100:
  ans = 9
elif N < 1000:
  ans = 9 + (N - 100 + 1)
elif N < 10000:
  ans = 909
elif N < 100000:
  ans = 909 + (N - 10000 + 1)
else:
  ans = 90909

print(ans)

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

print(counter)

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())
keta = len(str(N))
cnt = 0

if (keta % 2 == 0):
    cnt += 9
    keta -= 1
    
    while (keta > 1):
        cnt += 9 * 10 ** (keta - 1)
        keta -= 2

else:
    cnt += N - 10 ** (keta - 1) + 1
    keta -= 2
    
    while (keta > 0):
        cnt += 9 * 10 ** (keta - 1)
        keta -= 2

print(cnt)

Solution (Python):

import sys


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

    print(result)

    return



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):
def main():
    N = input()
    cnt = 9
    len_n = len(N)
    if len_n == 1:
        cnt = int(N)
    elif len_n % 2 == 0:
        len_n -= 1
    else:
        cnt += int(N[1:]) + 1
        if int(N[0]) > 1:
            cnt += (int(N[0])-1) * 10 ** (len_n-1)
        len_n -= 2
    while len_n > 1:
        cnt += 10 ** (len_n - 1) * 9
        len_n -= 2
    print(cnt)


if __name__ == '__main__':
    main()

Solution (Python):
import sys

n = sys.stdin.readline().rstrip()
l = len(n)

def main():
    cnt = 0
    for i in range(0, l, 2):
        if i < l-1:
            cnt += 10 ** (i + 1) - 10 ** i
        else:
            cnt += int(n) - (10 ** i - 1)

    return cnt

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

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

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

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

answer = sum(len(str(i))&1 for i in range(1,N+1))
print(answer)

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):
def readints():
    return list(map(int, input().split()))


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

print(len(list(filter(lambda n: len(str(n)) % 2 == 1, range(1, n + 1)))))

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

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

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

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

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

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



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

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

ans = 0
for k in (1,3,5):
  tmp = min(10**k - 1, N) - 10**(k-1) + 1
  

  if tmp > 0:
    ans += tmp
  else:
    break

print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = input()

total = 0
for i in range(1, len(N) + 1, 2):
	if i == len(N):
		total += int(N) - 10**(i-1) + 1
	else:
		total += 9*10**(i-1)

print(total)

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

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

Solution (Python):




def main():
    N = int(input())
    S = [1 if len(str(n)) % 2 == 1 else 0 for n in range(1, N + 1)]
    print(sum(S))


if __name__ == "__main__":
    main()

Solution (Python):
n = input()

l = len(n) 

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

Solution (Python):
N = input()



ans = 0

for j in range(1,int(N)+1):
    if len(str(j)) % 2 == 1:
        ans += 1
    else:
        continue
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):
ans = 0
n = int(input())
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=input()
digit=len(N)
N=int(N)
d=1
ans=0
for i in range(0,digit-1):
    if i%2==0:
        ans+=10**(i+1)-10**i
if digit%2==1:
    ans+=N-10**(digit-1)
    ans+=1
print(ans)