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

a = str(n)
result = 0

if len(a) == 1:
    result += n
else:
    result += 9
    i = 3
    while i <= len(a)-1:
        result += 10**i - 10**(i-1)
        i += 2
    if len(a)%2 == 1:
        result += n - 10**(len(a)-1)+1
print(result)

Solution (Python):
s=input()
a=int(s)
b=0
if a<10:
  b=a
elif 10<=a<100:
  b=9
elif 100<=a<1000:
  b=a-90
elif 1000<=a<10000:
  b=909
elif 10000<=a<100000:
  b=a-9999+909
elif 100000<=a<1000000:
  b=90909
else:
  b=a-909090
print(b)

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

a = []

for i in range(N+1):
	j = i
	a.append(j)

a.pop(0)

b = []
for i in a:
	i = str(i)
	b.append(i)

counter = 0


for i in b:
	if len(i)%2 !=0:
		counter+=1

print(counter)

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

solve()

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 p_b():
    n = int(input())

    a = list(map(int, list(str(n))))
    a.reverse()

    ans = 0

    for i in range(len(a)):
        if i % 2 == 1:
            continue

        if i == len(a) - 1:
            ans += n - 10 ** i + 1
        else:
            ans += 9 * 10 ** i

    print(ans)
    
p_b()

Solution (Python):
a = int(input())
if a<10:
    print(a)
elif a < 100:
    print(9)
elif a < 1000:
    print(9 + a - 99)
elif a < 10000:
    print(909)
elif a < 100000:
    print(909 + a - 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):

import sys


def solve(N: int):
    k = len(str(N))

    result = 0
    for k_i in range(1, k, 2):
        result += 9 * 10 ** (k_i - 1)
    if k % 2 != 0:
        result += N - 10 ** (k - 1) + 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):
n=int(input())
k=0
t=n

while t>0:
  t //= 10
  k += 1

s=0
if k%2:
  s = n+1-10**(k-1)
  k -= 1

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

print(s)

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

print(count)

Solution (Python):
import math
count = 0
sum = 0
N = int(input())
for i in range(N+1):
  while i != 0:
    i = math.floor(i/10)
    count +=1
  if count%2 == 1:
    sum +=1
    count = 0
print(sum)

Solution (Python):
N = int(input())
if N <10:
  print(N)
elif N >=10 and N<100:
  print(9)
elif N>=100 and N<1000:
  print(9+(N-99))
elif N >= 1000 and N<10000:
  print(9+900)
elif N >= 10000 and N<100000:
  print(9+900+(N-9999))
else:
  print(9+900+90000)

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

Solution (Python):
N = input()
m = len(N)
ans = 0
if m % 2 == 1:
  ans += int(N) - (10**(m-1)) + 1

for i in range(-(-m)//2):
  ans += 10**(2*i+1)-10**(2*i)

print(ans)

Solution (Python):


N = int(input())

keta = len(str(N))

count = 0

if keta%2 == 1:
    if keta == 1:
        print(N)
    else:
        for i in range(keta):
            if i%2 == 0:
                continue
            else: 
                count += 10**i-10**(i-1)
        count +=N-10**(keta-1)+1
        print(count)
else:
    for i in range(keta):
        if i %2 ==0:
            continue
        else:
            count += 10**i-10**(i-1)
    print(count)

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

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

print(count)

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

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

Solution (Python):
N = int(input())
count = 0
for n in range(N + 1):
    a = [int(b) for b in list(str(n))]
    if len(a) % 2 == 1:
        count += 1
print(count-1)

Solution (Python):
N = int(input())
count = 0
for n in range(N + 1):
    a = [int(b) for b in list(str(n))]
    if len(a) % 2 == 1:
        count += 1
print(count-1)

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

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

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

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

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

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

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):
    if len(str(n)) % 2 == 1:
        count += 1 

print(count)

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

def ketasuu(N):
  N=str(N)
  return len(N)

ans=0
keta=ketasuu(N)

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

print(ans)

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

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

Solution (Python):


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

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


if __name__ == "__main__":
    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):
import math
N = int(input())
ans=0
for i in range(N +1):
    if i>0 and math.ceil(math.log10(i+1))%2==1 :
        ans += 1
print(ans)

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

Solution (Python):
n=int(input())
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(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())
if 1<=n<=9:
    print(n)
elif 10<=n<=99:
    print(9)
elif 100<=n<=999:
    print(n-99+9)
elif 1000<=n<=9999:
    print(909)
elif 10000<=n<=99999:
    print(n-9999+909)
else:
    print(90909)

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

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

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

Solution (Python):
import math










N = int(input())
ans = 0

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

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

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

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

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

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

Solution (Python):

n = int(input())

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

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

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

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

ans = 0

for i in range(1,7):
    if n%(10**i)==n:
        
        break

if i ==1:
    ans = n
elif i ==2:
    ans = 9
elif i ==3:
    ans = 9+(n-99)
elif i ==4:
    ans = 909
elif i ==5:
    ans = 909+(n-9999)
elif i ==6:
    ans = 90909

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):
from sys import stdin
N = int(stdin.readline().rstrip())
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 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)
else:
  print(90909)

Solution (Python):
n = int(input())
d = 0;aux = n
while(aux>0):
  aux//=10
  d+=1
ans = 0

if(d&1): ans+= n-10**(d-1)+1
if(d>1): ans+=9
if(d>3): ans+=999-100+1
if(d>5): ans+=99999-10000+1
print(ans)

Solution (Python):
num = list(range(1, (int(input())+1)))

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

print(count)

Solution (Python):
n=int(input())
if n==1000000:
  ans=90910
elif n>=100000:
  ans=90909
elif n>=10000:
  ans=909+(n-9999)
elif n>=1000:
  ans=909
elif n>=100:
  ans=9+(n-99)
elif n>=10:
  ans=9
else:
  ans=n
print(ans)

Solution (Python):
s = input()
n = int(s)
m = len(s)
ans = 0
i = 1
while(True):
    if i == m:
        ans += n - 10 ** (i - 1) + 1
        break
    elif i > m:
        break
    ans += 9 * 10 ** (i - 1)
    i += 2
print(ans)

Solution (Python):
s = input()
n = int(s)
m = len(s)
ans = 0
i = 1
while(True):
    if i == m:
        ans += n - 10 ** (i - 1) + 1
        break
    elif i > m:
        break
    ans += 10 ** i - 10 ** (i - 1)
    i += 2
print(ans)

Solution (Python):
num=int(input())
i=1
list=[]
for i in range(num):
    i+=1
    if len(str(i))%2==1:
        list.append(i)


print(len(list))

Solution (Python):
n=int(input())
count=0
if n>=10:
    count+=9
    if n>=1000:
        count+=900
        if n>=100000:
            count+=90000
        else:
            if n>=10000:
                count+=n-10000+1
    else:
        if n>=100:
            count+=n-100+1
    print(count)
else:
    print(n)

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

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

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

print(str(geko))

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())
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)
elif n==100000:
    print(90909)

Solution (Python):
n = int(input())
ans = 0
while n > 0:
    if len(str(n)) % 2 != 0:
        ans += 1
    n -= 1
print(ans)

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

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

digits = [(N // (10 ** i) % 10) for i in range(6)]

for i in range(6):
    i_top = 5 - i
    if digits[i_top] > 0: break

ans = 0
for i in range(0, i_top):
    if i % 2 > 0: continue
    ans += (9 * (10 ** i))

if i_top % 2 == 0:
    ans += (N - (10 ** i_top) + 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):
x = input()
m = len(x)
x = int(x)

p = m//2
q = m%2

if q==1:
  if p==0:
    print(x)
    exit()
  else:
    a = 90
    while(p>0):
      x -= a
      a *= 100
      p -= 1
    print(x)
    exit()
else:
  if p==0:
    print(0)
    exit()
  else:
    x = 0
    a = 9
    while(p>0):
      x += a
      a *= 100
      p -= 1
    print(x)
    exit()

Solution (Python):

a=input()

ans = 0

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

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

cnt = 0

for i in range(1, N+1):
    len_s = len(str(i))
    if len_s == 1 or len_s == 3 or len_s == 5:
        cnt += 1

print(cnt)

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

if l==1:
  print(N)
elif l==2:
  print(9)
elif l==3:
  print(N-90)
elif l==4:
  print(909)
elif l==5:
  print(N-9090)
else:
  print(90909)

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

digits_num = 0
q = 1
n = N

while q > 0:
    q = n // 10
    n = q
    digits_num += 1

one_digits = 9 - 1 + 1 
three_digits = 999 - 100 + 1
five_digits = 99999 - 10000 + 1

if digits_num == 6:
    print(one_digits + three_digits + five_digits)
elif digits_num == 5:
    print(one_digits + three_digits + (N - 10000 + 1))
elif digits_num == 4:
    print(one_digits + three_digits)
elif digits_num == 3:
    print(one_digits + (N - 100 + 1))
elif digits_num == 2:
    print(one_digits)
else:
    print(N - 1 + 1)

Solution (Python):
n=str(input())
s=int(n)
k=len(n)
ans=0
if k==1:
    ans=s
elif k==2:
    ans=9
elif k==3:
    ans=9+s-99
elif k==4:
    ans=909
elif k==5:
    ans=909+s-9999
elif k==6:
    ans=90909
print(ans)

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

print(n) if 1<=n<=9 else print(9) if 10<=n<=99 else print (n-90) if 100<=n<=999 else print(909) if 1000<=n<=9999 else print(n-9090) if 10000<=n<=99999 else print(90909)

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

print(ans)

Solution (Python):
N = int (input())
if N < 10:
  print (N)
elif N >=10 and N <100:
  print ("9")
elif N >=100 and N < 1000:
  print (N - 99 + 9)
elif N >= 1000 and N < 10000:
  print ("909")
elif N >=10000 and N < 100000:
  print (N - 9999 + 900 + 9)
elif N == 100000:
  print ("90909")

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

Solution (Python):
def ketasu(num):
    if num == 0:
        return 1
    else:
        ans = 0
        while num != 0:
            num = num // 10
            ans += 1
        return ans

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

Solution (Python):
import sys
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())
cnt = 0
for i in range(1, N+1):
    if len(str(i)) % 2 == 1:
        cnt += 1
print(cnt)

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

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

print(count)

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

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

print(x)

Solution (Python):
n = input()

counter = 0
for val in range(1,int(n)+1):
    if len(str(val))%2 != 0:
        counter +=1

print(counter)

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

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

Solution (Python):
import math
n = int(input())
total = 0
word = str(n)
val1 = len(word)
ans = 0
if val1==1:
	ans = n
elif val1==2:
    ans = 9
elif val1==3:
	ans = 9+n-99
elif val1==4:
	ans = 909
elif val1==5:
	ans = 909+n-9999
else:
	ans = 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())
d = len(str(N))
ans = 0
if d == 1:
    ans = N
elif d == 2:
    ans = 9
elif d == 3:
    ans = 9 + N - 99
elif d == 4:
    ans = 9 + 999 - 99
elif d == 5:
    ans = 9 + 999 - 99 + N - 9999
else:
    ans = 9 + 999 - 99 + 99999 - 9999
print(ans)

Solution (Python):
N=int(input())
length = len(str(N))
count = 0
for i in range(1,length,2):
    count += 9*(10**(i-1))

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

print(count)

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

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

print(ans)

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

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

Solution (Python):
n=int(input())
even = lambda x: len(list(str(x))) % 2 != 0
res = len(list(filter(even, range(1, n+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):
import math
n=int(input())
a=int(math.log10(n))
i=0
p=0
while i<a:
    if i%2==0:
        p+=9*10**i
    i+=1
if a%2==0:
    print(p+n-10**a+1)
else:
    print(p)

Solution (Python):
N = int(input())
N_list = list(range(1,N+1))
ans = 0

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

print(ans)

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

count = 0

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

print(count)

Solution (Python):
from sys import stdin

n = stdin.readline().rstrip()

count = 0
if (len(n)) % 2 == 1:
  count += int(n)-10**(len(n)-1)+1

for x in range(len(n)):
  if x % 2 == 1:
    count += 10**x - 10**(x-1)

print(count)

Solution (Python):
a = int(input())
l=[]
for i in range(1,a+1):
    l.append(str(i))
o=len(l)
rl=[]
for j in range(o):
    if len(l[j])%2!=0:
        rl.append(l[j])

print(len(rl))

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

Solution (Python):
N = raw_input()

digit_num = len(str(N))
digit_counter = 2
minus_val = 0

while True:
  if digit_counter >= digit_num:
    if digit_num % 2 == 0:
      minus_val += (int(N) - pow(10, digit_num - 1) + 1)
    break
  minus_val += 9 * pow(10, digit_counter - 1)
  digit_counter += 2

print int(N) - minus_val

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

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

Solution (Python):

N = int(input())
len_N = len(str(N))

ans = 0

if len_N == 6:
    ans = ((10**5 -1) - (10**4) +1) + ( (10**3 -1) -(10**2) +1) + 9
if len_N == 5:
    ans = (N - (10**4) +1) + ( (10**3 -1) -(10**2) +1) + 9 
if len_N == 4:
    ans = ( (10**3 -1) -(10**2) +1) + 9 
if len_N == 3:
    ans = ( N -(10**2) +1 ) + 9 
if len_N == 2:
    ans =  9
if len_N == 1:
    ans = N

print(ans)

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

Solution (Python):
N = int(input())
l = len(str(N))-1
count = 0
for digit in range(l//2+1):
    count += len(range(10**(digit*2), min(10**(digit*2+1), N+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):
def main(): 
    n = input()
    digit = len(n)

    ans = 0

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

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):

    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
n=int(input())

a=n//10000
b=(n-10000*a)//1000
c=(n-10000*a-1000*b)//100
d=(n-10000*a-1000*b-100*c)//10
e=(n-10000*a-1000*b-100*c-10*d)


if n==100000:
	print(90909)

elif a==0:
	if b==0:
		if c==0:
			if d==0:
				print(n)
			else:
				print(9)
		else:
		  print(n-90)
	else:
		print(909)
else:
	print(n-9090)

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

ans = 0

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

print(ans)

Solution (Python):

import sys


def solve(N: int):
    ans = 100000
    if(0  <= N <= 99):
        ans = min(9,N)
    elif(100 <= N <= 9999):
        ans = min(N, 999)-99+9
    elif(10000 <= N <= 100000):
        ans = min(N, 99999) - 9999 + 999 - 99 + 9

    print(ans)
    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):
n=input()
N=int(n)
n=list(n)
n=[int(i) for i in n]
s=len(n)
if(s==6):
    print(90909)
elif(s==5):
    print(9+900+N-9999)
elif(s==4):
    print(909)
elif(s==3):
    print(9+N-99)
elif(s==2):
    print(9)
else:
    print(N)

Solution (Python):
def main():
  n = int(input())
  l = [0 for i in range(n+1)]
  for i in range(1,n+1):
    if i < 10:
      l[i] = l[i-1] + 1
    elif i < 100:
      l[i] = l[i-1]
    elif i < 1000:
      l[i] = l[i-1] + 1
    elif i < 10000:
      l[i] = l[i-1]
    elif i < 100000:
      l[i] = l[i-1] + 1
    elif i == 100000:
      l[i] = l[i-1]
    else:
      break
  print(l[n])

if __name__ == "__main__":
  main()

Solution (Python):
N = int(input())
ans = 0
n_digit = len(str(N))
for i in range(1, n_digit, 2):
    ans += 10**i - 10**(i-1)
if n_digit % 2 == 1: ans += N - 10**(n_digit - 1) + 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())
if n==100000:
  print(90909)
elif 10000<=n<=99999:
  print((n-10000)+910)
elif 1000<=n<=9999:
  print(909)
elif 100<=n<=999:
  print((n-100)+10)
elif 10<=n<=99:
  print(9)
elif 1<=n<=9:
  print(n)

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

l = len(str(n))

if l == 1:
    ans = n - 10**(l-1) + 1
    print(ans)
elif l == 2:
    print(9)
elif l == 3:
    ans = n - 10**(l-1) + 1 + 9
    print(ans)
elif l == 4:
    print(9+999-100+1)
elif l == 5:
    ans = n - 10**(l-1) + 1
    print(ans + 9+999-100+1)
elif l == 6:
    print(9+999-100+1 + 99999 - 10000 + 1)

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

counter = 0

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

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

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

Solution (Python):
import sys
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))
from collections import deque  
from collections import defaultdict  
from heapq import heapify, heappush, heappop, heappushpop  
from bisect import bisect_left, bisect_right  
sys.setrecursionlimit(int(1e+6))
MOD = int(1e+9) + 7



def main():
    S = i2s()
    N = int(S)
    if len(S) == 1:
        n = N
    elif len(S) == 2:
        n = 9
    elif len(S) == 3:
        n = N - 90
    elif len(S) == 4:
        n = 909
    elif len(S) == 5:
        n = N - 9090
    else:
        n = 90909
    print(n)

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):
str_N = input()
t = len(str_N)
N = int(str_N)

sum = 0

if t % 2 ==0:
    for i in range(t//2):
        sum += 9*(100**(i))
    print(sum)
else:
    for i in range((t-1)//2):
            sum += 9*(100**(i))
    sum += N - 10**(t-1) + 1
    print(sum)

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

ans = 0

if a >= 1 and a <= 99:
    ans = min(a, 9)
elif a>=100 and a<=999:
    ans = a-90
elif a>=1000 and a<=9999:
    ans = 909
elif a>=10000 and a<=99999:
    ans = a-9090
else:
    ans = 90909

print(ans)

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

count = 0
for i in range(1, N+1):
    if 10**0 <= i < 10**1:
        count += 1
    elif 10**2 <= i < 10**3:
        count += 1
    elif 10**4 <= i < 10**5:
        count += 1

print(count)

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

Solution (Python):


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

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

if n < 10:
    print(n)

elif n < 100:
    print(9)
elif n < 1000:
    print(9 + n-100+1)
elif n < 10000:
    print(9+999-100+1)
elif n < 100000:
    print(9+999-100+1 +n-10000+1)
elif n == 100000:
    print(90909)

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

Solution (Python):
import math

while True:
    try:
        N = int(input())
        m = int(math.log(N, 10))

        ans = 0
        for exp in range(0, m, 2):
            ans += 9 * 10 ** exp
        
        if (m%2 == 0):
            ans += min(N, 10**(m+1)-1) - 10**m + 1
        print(ans)
            
    except:
        break

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    li = [x for x in range(1, N + 1)]
    print(len(list(filter(lambda x: len(str(x)) % 2 == 1, li))))

Solution (Python):
def count_digits(N):
        N_temp = N
        digits = 0
        while N_temp != 0:
                digits += 1
                N_temp = int(N_temp/10)
        
        return digits

N = int(input())
ans = 0
for i in range(1,N+1):
        x = count_digits(i)
        if x%2 == 1:
                ans += 1
        else:
                pass

print(ans)

Solution (Python):
N = int(input())
i = 1
while N // (10**i) > 0: 
    i += 1
 
ans = 0    
if i % 2 == 0:
    for j in range(i//2):
        ans += 9*(10**(2*j))
else:
    for j in range(i//2):
        ans += 9*(10**(2*j))
    ans += (N-10**(2*(i//2))+1)

print(ans)

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

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

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

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

Solution (Python):
import math

n = int(input())
cnt = 0
for i in range(1,n+1):
    cnt += 1 if math.log10(i)//1%2 == 0 else 0
print(cnt)

Solution (Python):
n = int(input())
 
ans = 0
 
if n >= 10:
  ans += 10 - 1
  if n >= 10**2:
    if n >= 10**3:
      ans += 10**3 - 10**2
      if n >= 10**4:
        if n == 10**5:
          ans += 10**5 - 10**4
        else:
          ans += n - 10**4 + 1
    else:
      ans += n - 10**2 + 1
else:
  ans += n
 
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())
count = 0
for i in range(1, N + 1):
    if 1<=i <=9 or 100<=i <= 999 or 10000<= i <= 99999:
        count += 1
    else:
    
        count +=0
print(count)

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):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    t = 0
    for i in range(1, n + 1):
        if len(str(i)) % 2 != 0:
            t += 1
    print(t)


if __name__ == '__main__':
    slove()

Solution (Python):


n = input()
int_n = int(n)
result = int_n


for i in range(1, int_n+1):
    if len(str(i))%2 == 0:
        result -= 1

print(result)

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

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

print(count)

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

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

if N < 100:
    print(min(N, 9))
elif N < 1000:
    print((N-99) + 9)
elif N < 10000:
    print(909)
elif N < 100000:
    print((N-9999) + 909)
elif N == 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())

def cl(n):
	nl = 1
	while n // 10 > 0:
		nl += 1
		n = n // 10
	return nl
	
print(sum([1 for i in range(n) if cl(i + 1) % 2 == 1]))

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

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

counter = 0

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

print(counter)