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-----
11

-----Sample Output-----
9

Among the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \ldots, 9.

Difficulty: introductory

Starter code:

Solutions:
n=input()

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

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

N = int(input())
Uneven_Numbers = []

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

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


n = int(input())
if n < 10:
    print(n)
elif 10 <= n <= 99:
    print((9))
elif 100 <= n <= 999:
    print((n - 90))
elif 1000 <= n <= 9999:
    print((9 + 900))
elif 10000 <= n <= 99999:
    print((n - 9090))
elif 100000 <= n <= 100000:
    print((9 + 900 + 90000))


N = int(input())
cnt = 0

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

# -*- coding: utf-8 -*-
N = int(input())

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

print(ans)


N = int(input())

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

print(count)

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

N = int(input())

odd_num = 0
for i in range(1, N + 1):

    if len(str(i)) % 2 == 1:
        odd_num += 1

print(odd_num)

N = int(input())

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

print(cnt)

N = int(input())

kazu = 1
if N < 10:
    kazu = N
elif N < 100:
    kazu = 9
elif N < 1000:
    kazu = N - 90
elif N < 10000:
    kazu = 900+9
elif N < 100000:
    kazu = N - 9000 - 90
elif N == 100000:
    kazu = 90000+900+9

print(kazu)


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

import array
import bisect


def answer(n: int) -> int:
    numbers = array.array('L')

    i = 0
    while 100 ** i <= n:
        start = 100 ** i
        stop = int('9' * len(str(start))) + 1
        numbers.extend(list(range(start, stop)))
        i += 1

    return bisect.bisect_right(numbers, n)


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


def __starting_point():
    main()

__starting_point()

N = input()
n = int(N)
ans = 0

if(len(N) == 1):
    print(n)
    return
if(len(N) % 2 == 1):
    ans += n - (10 ** (len(N)-1)) + 1
    n -= ans
    for i in range(1,len(str(n))+1):
        if(i % 2 == 1):
            ans += 9 * (10 ** (i - 1))
    print(ans)
else:
    n -= n - (10 ** (len(N)-1)) + 1
    for i in range(1,len(str(n))+1):
        if(i % 2 == 1):
            ans += 9 * (10 ** (i - 1))
    print(ans)

N = int(input())

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

print(cnt)

N = int(input())

keta = []
for i in range(1,N+1):
    keta.append(len(str(i)))

odd = list(filter(lambda n: n % 2 == 1, keta))
print(len(odd))

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

def LI(): return list(map(int, input().split()))
def I(): return map(int, input().split())
mod = 10**9 + 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)
def __starting_point():
  main()
__starting_point()

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

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

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

print(ans)



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


n = int(input())
ans = 0

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

n = int(input())

count = 0

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

print(count)

n = int(input())

ans = 0

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

print(ans)


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

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

print(cnt)

n = int(input())

s = len(str(n))

if s == 1:
    print(n)
elif s == 2:
    print((9))
elif s == 3:
    print((n-90))
elif s == 4:
    print((9+900))
elif s == 5:
    print((9+900+n-10000+1))
else:
    print((90909))


n = int(input())


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

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

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

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

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

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


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


n = int(input())
# n個の整数のリスト
num_list = []
# 偶数の桁数の整数のリスト
num_odd_list = []

# n個の整数のリストに代入
for i in range(1, n + 1):
    num_list.append(i)

# 偶数の桁数の整数をリストに代入
for j in num_list:
    if 10 <= j < 100 or 1000 <= j < 10000 or 100000<= j < 1000000:
       num_odd_list.append(j)

# 全体の整数の数から偶数の桁数の整数の数を引く
print(len(num_list) - len(num_odd_list))

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

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

N = int(input())
num = 0

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

a = input()
N = int(a)

if N == 10**5:
    print((90909))
elif N >= 10**4:
    print((N-(9000+90)))
elif N >= 10**3:
    print((909))
elif N >= 10**2:
    print((N-90))
elif N >= 10:
    print((9))
else:
    print(N)


N = int(input())

i = 1
result = 0

while i <= N:
    i_l = len(str(i))

    if i_l % 2 != 0:
        result += 1

    i += 1

print(result)

N = int(input())

answer = 0

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

print(answer)

n = int(input())
l = list()
for i in range(1, n+1):
    m = list(str(i))
    if len(m) % 2 != 0:
        l.append(i)
print((len(l)))


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

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

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

n = int(input())
ans = 0

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

print(ans)

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

print(cnt)


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

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

def __starting_point():
    main()
__starting_point()

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

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

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

N = int(input())

ans = 0

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

N = int(input())
n = list(map(int, str(N)))
a = len(n)

if a % 2 == 0:
    print((int((10**int(a)-1)/11)))
else:
    if a == 1:
        print(N)
    else:
        print((int(((100**int(a/2)-1)/11))+N-10**int(a-1)+1))


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

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

print(cnt)

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

N=int(input())

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

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

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


N = int(input())

# N以下の正の整数のうち、桁数が奇数（1桁、3桁、5桁など）であるようなものの個数を出力

count = 0

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

import math
import collections
import itertools

def resolve():

    N=int(input())

    ans=0
    for i in range(1,N+1):
        if(10<=i<=99 or 1000<=i<=9999 or 100000<=i<=999999):
            continue
        ans+=1
    print(ans)
resolve()


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

print(cnt)

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

# import math
# import statistics
# import itertools
a=int(input())
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(int(i))
# H,W,K= map(int,input().split())
# f = list(map(int,input().split()))
# g = [input().split for _ in range(a)]
# h = []
# for i in range(a):
#     h.append(list(map(int,input().split())))
# a = [[0] for _ in range(H)]#nizigen

lis=[str(i) for i in range(1,a+1)]

count=0
for i in lis:
    if int(len(i))%2!=0:
        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)


def __starting_point():
    N = int(input())
    ans = 0
    for n in range(1, N+1):
        if len(str(n))%2 != 0:
            ans += 1

    print(ans)
__starting_point()

N = int(input())
cnt = 0

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

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



n = int(input())

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



n = int(input())

ans = 0

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

print(ans)

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

n = int(input())

ans = 0


def check_even(n):
    n_l = list(str(n))
    n_count = len(n_l)
    if n_count % 2 == 0:
        return True
    else:
        return False


for i in range(1, n + 1):
    if check_even(i):
        continue
    ans += 1
print(ans)


#ABC136 B

N = int(input())
import math
digit = int(math.log10(N)) + 1
S = 0
if digit % 2 == 0:
    for i in range(1,int(digit/2) + 1):
        S += pow(10,2*i-1) - pow(10,2*i-2)
    print(S)
if digit % 2 == 1:
    for i in range(1,int((digit + 1)/2)):
        S += pow(10,2*i -1) - pow(10,2*i - 2)
    S += N - pow(10,digit - 1) + 1
    print(S)

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

N=int(input())

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

    return odd_count

print((ans136(N)))


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

print(ans)

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


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

print(ans)

import math

n = int(input())
count = 0

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

if len(str(n)) % 2 == 0:
    count -= 1
    
print(count)

n = int(input())

l = len(str(n))

if l == 6:
    ans = 90909

elif l == 5:
    ans = n - 9090

elif l == 4:
    ans = 909

elif l == 3:
    ans = n - 90

elif l == 2:
    ans = 9

else:
    ans = n

print(ans)

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

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


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

print(count)

N=int(input())
Ans=0

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

print(Ans)

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

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

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-100+1))
elif 1000<=N and N<10000:
  print(909)
elif 10000<=N and N<100000:
  print(909 + (N-10000+1))
else:
  print(90909)

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

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

n = int(input())

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

print(ans)



n = int(input())
ans = 0

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

print(ans)

import math

N = int(input())
m = int(math.log10(N))+1
a = N//(pow(10,m))

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

if m%2 == 1:
    ans += N-pow(10,m-1)+1
print(ans)


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

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

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

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

N = int(input())
ans = 0

def count_dig(N):
    cnt = 0
    while(True):
        cnt += 1
        if(N < 10):
            break
        else:
            N /= 10
    return cnt

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

print(ans)