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())
if N == 10**5:
  print("90909")
elif N >= 10**4:
  resid=N-10**4+1
  print(str(9+900+resid))
elif N >= 10**3:
  print("909")
elif N >= 10**2:
  resid=N-10**2+1
  print(str(9+resid))
elif N >= 10:
  print("9")
else:
  print(str(N))

Solution (Python):
N = int(input())
ans = 0
for n in range(1, N + 1):
    ns = str(n)
    if len(ns) % 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())
print(len(list(filter(lambda x: len(str(x))%2 == 1, 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):
    digit = 1
    while i//10 > 0:
        digit += 1
        i /= 10
    if digit%2 == 1:
        ans += 1
print(ans)

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

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

if keta%2 == 1:
    num = "1"
    for i in range(keta - 1):
        num += "0"
    ans += (int(n) - int(num) + 1)

print(ans)

Solution (Python):
import math

n = input()

digits = len(n)
count = 0


def even_count(d):
    c = 0
    for i in range(0, int(d), +2):
        c += math.pow(10, i)
    return c * 9


if digits % 2 == 0:
    count += even_count(digits)
else:
    if digits - 1 != 0:
        count += even_count(digits - 1)
    count += int(n) - math.pow(10, digits - 1) + 1

print(int(count))

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

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

Solution (Python):
import math

n = input()

digits = len(n)
count = 0


def even_count(d):
    c = 0
    for i in range(0, int(d), +2):
        c += math.pow(10, i)
    return c * 9


if digits % 2 == 0:
    count += even_count(digits)
else:
    if digits - 1 != 0:
        count += even_count(digits - 1)
    count += int(n) - math.pow(10, digits - 1) + 1

print(int(count))

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

ans = 0
if n > 99998:
  ans = 90909
elif n > 9998:
  ans = 909+n-9999
elif n > 998:
  ans = 909
elif n > 98:
  ans = 9+n-99
elif n > 8:
  ans = 9
else:
  ans = n

print(ans)

Solution (Python):
a = input()
l = len(a)
a = int(a)
num=0
if(l==6):
  num = 90909
elif(l==5):
  num = 909 + (a - 9999)
elif(l==4):
  num = 909
elif(l==3):
  num = 9 + (a - 99)
elif(l==2):
  num = 9
elif(l==1):
  num = a
print(num)

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

Solution (Python):
a = int(input())
unchi = 0
while a>=1:
    if 99999 >= a >= 10000:
        unchi += 1
    elif 999 >= a >= 100:
        unchi += 1
    elif 9 >= a >= 1:
        unchi += 1
    a -= 1
print(unchi)

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

count = 0
for n in range(1, N + 1):
    if not (len(str(n)) / 2).is_integer():
        count += 1

print(count)

Solution (Python):
import numpy as np

N = int(input())

k = len(str(N))
ans = 0

if k%2 == 0:
    for i in np.arange(1, k+1, 2):
        ans += 9 * (10**(i-1))
    print(ans)
    
else:
    for i in np.arange(1, k, 2):
        ans += 9 * (10**(i-1))
    ans += N - 10**(k-1) +1
    print(ans)

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

print(result)

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

length = len ( N_str )

num = 0

for i in range(length-1):
    if (i%2!=0):
        continue
    num = num + 9 * 10 ** i

if (length%2!=0):    
    num = num + ( N - 10**(length-1) + 1 )

print ( num )

Solution (Python):
n = int(input())
m = n
cnt = 0
while(n>=1):
    n = n/10
    cnt += 1
ans = 0
i = 1
while( i < cnt):
    ans += 9 * 10**(i-1)
    i += 2
    

if cnt%2 == 1:
    ans += m-10**(i-1) + 1
    
print(ans)

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

Solution (Python):
N=int(input())
s=len(str(N))
ans=0

if s==6:
    ans = 10**(1-1)*9+10**(3-1)*9+10**(5-1)*9
elif s==5:
    ans = 10**(1-1)*9+10**(3-1)*9+(N-10000+1)
elif s==4:
    ans = 10**(1-1)*9+10**(3-1)*9
elif s==3:
    ans = 10**(1-1)*9+(N-100+1)
elif s==2:
    ans = 10**(1-1)*9
else:
    ans = N-1+1

print(ans)

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

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

print(ans)

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

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

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

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

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

print(count)

Solution (Python):
j = sum(1 for number in range(1, int(input()) + 1)
        if len(str(number)) % 2 != 0)

print(j)

Solution (Python):
def uneven(number):
    result = []
    for x in range(1, number + 1):
        numberOfDigits = 1
        y = x

        if(y >= 100000):
            numberOfDigits = numberOfDigits + 5
            y = y / 100000

        if(y >= 10000):
            numberOfDigits = numberOfDigits + 4
            y = y / 10000

        if(y >= 1000):
            numberOfDigits = numberOfDigits + 3
            y = y / 1000

        if(y >= 100):
            numberOfDigits = numberOfDigits + 2
            y = y / 100

        if(y >= 10):
            numberOfDigits = numberOfDigits + 1

        if (numberOfDigits % 2 != 0):
            result.append(x)

    print(len(result))
    return len(result)
  
uneven(int(input()))

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







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

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

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

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

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

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

print(cnt)

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

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

print(cnt)

Solution (Python):
n = int(input())
a = len(str(n))
b = 0
c = a//2

if a%2 == 0:
    for j in range(c):
        b += 9*100**j
    print(b)
else:
    for j in range(c):
        b += 9*100**j
    print(n-10**(a-1)+1+b)

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

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

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

count = 0

if 1<= A_int <=10**5:
    for i in range(1,A_int+1,1):
        check = str(i)
        if len(check)%2==1:
            count += 1
        else:
            pass
else:
    pass

print(count)

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

if len(str(a)) //2 *2 == len(str(a)):
    for i in range(len(str(a))//2):
        b += 10 **(2 *i) *9
    print(b)
else:
    for i in range(len(str(a))//2):
        b += 10 **(2 *i) *9
    b += a-10**(len(str(a))-1)+1
    print(b)

Solution (Python):
a=int(input())
if 1<=a<=9:
    b=a
if 10<=a<=99:
    b=9
if 100<=a<=999:
    b=a-90
if 1000<=a<=9999:
    b=909
if 10000<=a<=99999:
    b=a-9090
if a==100000:
    b=90909
print(b)

Solution (Python):
n = int(input())
res = 0
def digit(x):
	d = 0
	while x:
		d += 1
		x //= 10
	return d
for i in range(1, n + 1):
	if digit(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)) in {1, 3, 5}:
        ans += 1

print(ans)

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

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

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

Solution (Python):
n=input()
x=len(n)
if x==1:
    print(int(n))

elif x<3:
    print(9)
elif x==3:
    print(9+int(n)-100+1)
elif x<5:
    print(909)
elif x==5:
    print(9+900+int(n)-10000+1)
else:
    print(90909)

Solution (Python):
N=int(input())
ct=0
for i in range(1,N+1):
    if len("{:d}".format(i))%2==1:
        ct+=1
print(ct)

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()
digits = len(n)
i = 0
count = 0
while (2*i+1) <= digits:
    if (2*i+1) == digits:
        count += int(n) - 10**(digits-1) + 1
        break
    else:
        count += (10**(2*i+1) - 1) - 10**(2*i) + 1
    i += 1

print(count)

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

if a < 10:
  print(a)
elif a < 100:
  print(9)
elif a < 1000:
  print(a - 90)
elif a < 10000:
  print(909)
elif a < 100000:
  print(a - 90 - 9000)
elif a == 100000:
  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):
n = int(input())

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

Solution (Python):
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
Mod = 1000000007



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




def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n < 2 is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))):
        if prime[i] == 1:
            for j in range(2*i,n):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n):
        if prime[i] == 1:
            res.append(i)
    return res

class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py

    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

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 cal(n, len=1):
    if (n // 10)  < 1:
        return len
    len+=1
    return cal(n/10, len)

n = int(input())

count = 0
for i in range(1,n+1):
    len = cal(i)
    if len % 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-90)
elif N <10000:
	print(909)
elif N <100000:
	print(N-9000-90)
else: 
	print(90909)

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

for i in range(1,N+1):
    if i >= 100000:
        continue    
    elif i >= 10000:
        ans += 1
    elif i >= 1000:
        continue
    elif i >= 100:
        ans += 1
    elif i >= 10:
        continue
    else:
        ans += 1

print(ans)

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

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

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

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

count = 0
l = len(str(N))

for i in range(l-1):
	if i%2 == 0:
		count += 10**i*9

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

print(count)

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

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

if n < 10:
    print(n)
    exit()

t = 10
k = 1
ans = 9
while t <= n:
    if k % 2 == 0:
        ans += t * 9
    t *= 10
    k += 1



if k % 2 == 1:
    ans -= t - n - 1

print(ans)

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

Solution (Python):
n = int(input())
nstr = str(n)
score = 0
ln = len(nstr)
lnfor = ln // 2

for i in range(lnfor):
  score += 9 * 100 ** i
if ln % 2 == 1:
  score += n - 10 ** (ln - 1) + 1
print(score)

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

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

print(cut)

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

print (cnt)

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

if True:
  max_d = int(len(str(n)))
  count = 0
  if max_d % 2 == 1:
    count = n - 10**(max_d-1) + 1
    for i in range(0, max_d-2, 2):
      count += 9*10**(i)
  else:
    for i in range(0, max_d-1, 2):
      count += 9*10**(i)
  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().rstrip())
d = 0
for i in range(1, a + 1):
  if len(str(i)) % 2 == 0:
    continue
  else:
    d += 1
print(d)

Solution (Python):
import math
inp = raw_input("")
n = int(inp)
base = int(math.log10(n))
total = 0
for i in range(0, base, 2):
  total += 9 * (10 ** i)
if base % 2 == 0:
  total += n - (10 ** base) + 1
print total

Solution (Python):
import math
inp = raw_input("")
n = int(inp)
base = int(math.log10(n))
total = 0
for i in range(0, base, 2):
  total += 9 * (10 ** i)
if base % 2 == 0:
  total += n - (10 ** base) + 1
print total

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

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<100:
	print(min(9,n))
elif n<10000:
	print(min(909,n-90))
else:
	print(min(90909,n-9090))

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

Solution (Python):
N = int(input())
N_list = list(map(int,[i for i in str(N)]))
N_list=N_list[::-1]


if len(N_list)%2==0:
  ans=0
  for i in range(len(N_list)):
    if i %2==0:
      ans+=9*(10**i)
else:
  ans=0
  for i in range(len(N_list)-1):
    if i % 2 ==0:
      ans+=9*(10**i)
  ans+=N - (10**(len(N_list)-1)) + 1

print(ans)

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

cnt = 0
if N < 10: 
  cnt = N
elif N < 100: 
  cnt = 9
elif N < 1000: 
  cnt = 9 + N - 100 + 1 
elif N < 10000: 
  cnt = 9 + 900
elif N < 100000: 
  cnt = 9 + 900 + N - 10000 + 1
else :
  cnt = 9 + 900 + 90000

print(cnt)

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

print(count-1)

Solution (Python):
n=int(input())
a=range(n+1)
cnt=-1
for x in a:
    if len(str(x))%2==1:
        cnt+=1
print(cnt)

Solution (Python):
def solve(n):
    if n < 10:
        return n
    elif n >= 10 and n < 100:
        return 9
    elif n >= 1000 and n < 10000:
        return 909
    elif n == 10**5:
        return 90909

    aux =  n - (10**(len(str(n)) -1)) + 1
    return aux + solve(10**(len(str(n)) -1)-1)

n = int(input())

ans = solve(n)
print(ans)

Solution (Python):
N = int(input())
list = [0]
i = 1
cnt = 0
while i <= N:
    if len(str(i)) % 2 != 0:
        cnt += 1
    i += 1
print(cnt)

Solution (Python):
a=int(input())
b=sum([10**i*9 for i in range(0, len(str(a))-1) if not i%2])
if len(str(a))%2:
    print()
    if len(str(a))==1:
        print(a)
    else:
        print(b+(a-10**(len(str(a))-1)+1))
else:
    print(b)

Solution (Python):
num = input()
result = 0

if len(num) != 1:
  result = int((len(num)-2)//2 * ("90") + "9")

if len(num) % 2 == 0:
  print(result)
else:
  numA = int("0" + (len(num) - 1) * "9")
  print(result + int(num) - numA)

Solution (Python):
num = input()

result = 0

if len(num) != 1:
  result = int((len(num)-2)//2 * ("90") + "9")

if len(num) % 2 == 0:
  print(result)
else:
  AAA = int("1" + (len(num) - 1) * "0") - 1
  print(result + int(num) - AAA)

Solution (Python):
n=int(input())
s=0
if n>=9:
    s+=9
else:
    s+=n
if n>=100:
    if n>=100 and n<=999:
        s+=n-100+1
    else:
        s+=900
if n>=10000:
    if n>=10000 and n<=99999:
        s+=n-10000+1
    else:
        s+=90000
print(s)

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

Solution (Python):

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


if __name__ == "__main__":
    main()

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(909+int(n)-10000+1)
else:
  print(90909)

Solution (Python):
l=[]
l.append(1)
for i in range(2,100001):
    T=list(str(i))
    if len(T)%2!=0:
        l.append(1+l[i-2])
    else:
        l.append(0+l[i-2])
n=int(input())
print(l[n-1])

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

Solution (Python):




if __name__ == "__main__":
    n = int(input())
    if n<10:
        print(n)
    elif n<100:
        print(9)
    elif n<1000:
        print(n-99+9)
    elif n<10000:
        print(909)
    elif n<100000:
        print(n-9999+909)
    elif n<1000000:
        print(90909)

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

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:
    count = n
elif n <100:
    count = 9
elif n <1000:
    count = n-90
elif n < 10000:
    count = 909
elif n < 100000:
    count = n-9090
else:
    count = 90909
 
print(count)

Solution (Python):


N = int(input())

odd = 0

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

print(odd)

Solution (Python):

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

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

if n <10:
    count = n
elif n <100:
    count = 9
elif n <1000:
    count = n-90
elif n < 10000:
    count = 909
elif n < 100000:
    count = n-9090
else:
    count = 90909

print(count)

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

Solution (Python):
f = lambda : raw_input().rstrip()
f1 = lambda : f().split()
f2 = lambda t : map(t, f1())

def main1():
    A, B, C = f2(int)
    print 0 if B + C <= A else (B + C) - A

def main2():
    n = int(f())
    p = 0
    ans = 0
    while 10**p <= n:
        if 10**(p+1) > n:
            ans = ans + n - 10**p + 1
        else:
            ans = ans + 10**(p+1) - 10**p 
        p = p + 2
    print ans
    
def main3():
    n = int(f())
    a = f2(int)
    m = 0
    for i in xrange(1,n):
        if a[i] < a[i-1]:
            m = m + 1
  
    print "Yes" if m < 2 else "No"

def main4():
    s = f()
    n = len(s)
    ans = [0]*n
    m = 1
    i = 1
    st = 0
    s = s + ("L" if s[-1]=="R" else "R")
    while i <= n:
        if s[i] != s[i-1]:
            
            j = st if s[i-1]=="L" else i
            
            if m&1:
                ans[j-1] = ans[j-1] + m/2 + (1 if s[i-1] == "R" else 0) 
                ans[j] = ans[j] + m/2 + (1 if s[i-1] == "L" else 0)
            else:
                ans[j-1] =  ans[j-1] + m/2
                ans[j] = ans[j] + m/2
            m = 0
            st = i
        
        i = i + 1
        m = m + 1
    print " ".join(map(str,ans)) 
         
if __name__=="__main__":
    main2()

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):
i = list(map(int, input().split()))
n = i[0]
s = 0

if(n==100000):
    s = 90909
elif(n>=10000):
    s = n - 9999 + 900 + 9
elif(n>=1000):
    s = 900 + 9
elif(n>=100):
    s = n - 99 + 9
elif(n>=10):
    s = 9
else:
    s = n

print(s)

Solution (Python):
N = input()
n = len(N) - 1

ans = sum([9 * 10 ** i for i in range(0, n, 2)])
if n % 2 == 0:
    ans += int(N) - 10 ** n + 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):
n = int(input())

x = 0

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

print(x)

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

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

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

count = 0

i = 1
while i <= N:
    if len(str(i)) % 2 != 0:
        count += 1
    i += 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:
        ans += 1
print(ans)

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

Solution (Python):
from sys import stdin
def ii(): return int(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def li(): return list(mi())
n=ii()
x=min(9, n)
if n>99:
    x+=min(900, n-99)
    if n>9999:
        x+=min(90000, n-9999)
print(x)

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

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

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

a = [0, 9, 0, 900, 0, 90000]

for i in range(1, 6):
    check *= 10

    if (n < check):
        check = int(check / 10)

        if (i % 2 == 1):
            cnt += n - check + 1

        break

    cnt += a[i]

print(cnt)

Solution (Python):
import sys

for l in sys.stdin:
    N = int(l)
    result = d = 0
    while d < 5:
        d += 1
        if d % 2 == 0:
            if N < (10**d):
                break
            continue
        result += (10**d) - (10**(d-1))
        if N < 10**d:
            result -= 10**d - N - 1
            break
    print(result)

Solution (Python):
N = int(input())
print(sum([1 if len(list(str(x))) % 2 != 0 else 0 for x in range(1, N+1)]))

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

try:
    ans = int("09" * int(length / 2))
except BaseException:
    ans = 0

if length % 2 == 1:
    s = "9" * (length - 1)
    ans += N - int(s) if s else N
print(ans)

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

Solution (Python):


import sys
from math import log10

N = int(sys.stdin.readline().rstrip())
len_n = int(log10(N)) + 1
s = N - 10**(len_n - 1) + 1 if len_n % 2 else 0
for i in range(1, len_n, 2):
    s += 9 * 10**(i - 1)
print(s)

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

print(ans)

Solution (Python):


import sys
from math import log10

N = int(sys.stdin.readline().rstrip())
len_n = int(log10(N)) + 1
s = N - 10**(len_n - 1) + 1 if len_n % 2 else 0
for i in range(1, len_n, 2):
    s += 9 * 10**(i - 1)
print(s)

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

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

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

Solution (Python):

N = input()

ans = 0

if len(N) == 1:
    ans = int(N)

else:
    for i in range(1, len(N) + 1, 2):

        dataS = N[i-1]

        if i == 1:
            ans = ans + 9

        elif i % 2 == 1:

            if i == len(N):
                data1 = (int(N[len(N) - i]) - 1)
                data2 = int(N[-(len(N)-1):]) + 1

                ans = ans + data1 *10**(i-1) + data2

            else:
                ans = ans + 9 * 10**(i-1)
            
print(str(ans))

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

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

print(c)

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

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

print(intCount)

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(9+900)
elif l ==5:
    print(9+999-99+N-9999)
elif N==100000:
    print(90909)

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

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

Solution (Python):
import sys

a = int(input())

cnt = 0

for i in range(1,10):
	cnt += 1
	if i == a :
		print (cnt)
		sys.exit()
if a < 100 :
	print (cnt)
	sys.exit()
for j in range(100,1000):
	cnt += 1
	if j == a :
		print (cnt)
		sys.exit()
        
if a < 10000 :
	print (cnt)
	sys.exit()
for k in range(10000,100000):
	cnt += 1
	if k == a :
		print (cnt)
		sys.exit()
if a == 100000 :
	print (cnt)
	sys.exit()

Solution (Python):
import math
s = input()
d = len(s)
ans = 0
if d % 2:
  ans += int(s) - pow(10, d-1) + 1
for i in range(1, d, 2):
  ans += 9*math.pow(10, i-1)
print(int(ans))

Solution (Python):
import math
N_str = input()
num = len(N_str)
N = int(N_str)
result = 0
for i in range(1, num):
  if i % 2 != 0:
    result += int(math.pow(10,i))-1 - int(math.pow(10,i-1)) + 1
if num % 2 !=0:
  result += N - int(math.pow(10,num-1)) + 1
  
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):
print(sum(len(str(i+1))%2for i in range(int(input()))))

Solution (Python):
import numpy as np

N = int(input())

array = np.arange(N)+1

n1=np.count_nonzero(array<10)
n2=np.count_nonzero((100<=array)&(array<1000))
n3=np.count_nonzero((10000<=array)&(array<100000))
ans=n1+n2+n3
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())
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):
    num_str = str(i)
    if len(num_str) % 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())
ans = 0
for i in range(1, N+1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)