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

keta = len(str(N))

ans = 0
if keta % 2:
    ans += N + 1 - 10 ** (keta - 1)

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

print(ans)

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

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

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

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):
def uneven_num(n):
    count = 0
    for i in range(n,0,-1):
        tmp = i
        keta = 0
        while True:
            tmp = tmp/10
            if tmp < 1:
                keta += 1
                break
            else:
                keta += 1

        if keta % 2 != 0:
            count += 1

    return count

if __name__ == '__main__':
    n = int(input())

    a = uneven_num(n)
    print("%d" %a)

Solution (Python):
s = input()

n = len(s)

s = int(s)
i = 1
ans = 0
while i < n:
  ans += 9 * (10**(i-1))
  i += 2
if i==n:
  ans += s - 10**(n-1) +1
  
print(ans)

Solution (Python):
N = input()
len_n = len(N)

ans = 0
if len_n % 2 == 0:
    for i in range(len_n // 2):
        ans += 9 * pow(10, 2*i)
else:
    for i in range(len_n // 2):
        ans += 9 * pow(10, 2*i)
    ans += int(N) - pow(10, 2*(len_n // 2)) + 1
print(ans)

Solution (Python):

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

print(cnt)

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

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

Solution (Python):

N = int(input())

L = 0 
t = N
while t:
    L += 1
    t = t // 10

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


if L % 2 == 1:
    ans += N - 10**(L-1) + 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(9 + 900 + (n - 9999))
else:
  print(90909)

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

length = len(str(N))

ans = 0

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

for i in range(1, length+1, 2):
    if i == length:
        break
    ans += 10 ** i - (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())
lists = list(range(1,N+1))
cnt = 0
for i in range(len(lists)):
    m = str(lists[i])
    if len(m) % 2 == 1:
        cnt += 1
print(cnt)

Solution (Python):
n = str(input())
m = len(n)
n = int(n)
x = 9
ans = 0
if m%2 == 0:
    for _ in range((m+1)//2):
        ans += x
        x *= 100

else:
    for _ in range((m+1)//2-1):
        ans += x
        x *= 100
    ans += n - 10**(m-1) +1

print(ans)

Solution (Python):
N = int(input())
n = N
ans = 0
k = 0
while True:
  m = n//(10**k)
  if(m <  10):
    break
  k += 1
for i in range(k):
  if(i%2==0):
      ans += 9*(10**i)
if (k%2 == 0):
    d = n - (10**k)+1
    ans += d
print(ans)

Solution (Python):
import numpy as np
n = int(input())
m = int(np.log10(n))
ans = 0

for i in range(m+1):
    if m%2 == 1:
        n = 10**m - 1
        m -= 1
    else:
        ans += n - 10**m + 1 
        n = 10**m - 1
        m -= 1

print(ans)

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

Solution (Python):
from sys import stdin

if __name__ == '__main__':
    N = int(stdin.readline().rstrip())
    ans = 0
    if N < 10:
        ans = N
    elif N < 100:
        ans = 9
    elif N < 1000:
        ans = 9 + ( N - 100 + 1 )
    elif N < 10000:
        ans = 9 + 900 
    elif N < 100000:
        ans = 9 + 900 + ( N - 10000 + 1 )
    else:
        ans = 9 + 900 + 90000
    print( ans )

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

digit = []
count = 0
for l in L:
    d = len(str(l))
    if d % 2 == 1:
        count += 1

print(count)

Solution (Python):
def main():
    n = int(input())
    nstr = str(n)
    nlen = len(nstr)
    ans0 = [0, 0, 9, 9, 909, 909, 90909][nlen]
    if nlen % 2 == 0:
        print(ans0)
        return
    print(ans0 + n - 10 ** (nlen - 1) + 1)


main()

Solution (Python):
n = input()

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

if len(n) % 2 == 1:
    ans += int(n) - (10**(len(n) - 1) - 1)
print(ans)

Solution (Python):
N=int(input())
n=str(N)
k=len(n)

if k==1:
    print(N)
elif k==2:
    print(9)
elif k==3:
    print((N//100-1)*100+N%100+10)
elif k==4:
    print(909)
elif k==5:
    print((N//10000-1)*10000+N%10000+910)
else:
    print(90909)

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

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

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

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

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

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

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


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



rtn = 0

if (keta == 1):
    rtn += n
elif (keta > 1):
    rtn += 9

if (keta == 3):
    rtn += n - 99
elif (keta > 3):
    rtn += 900

if (keta == 5):
    rtn += n - 9999
if (keta > 5):
    rtn += 90000

print(rtn)

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

Solution (Python):
def main():
    n = int(input())
    lst  = list(range(1,n+1))

    lst = [len(str(i)) for i in lst]

    lst = [i for i in lst if i%2 == 1]

    print(len(lst))
    
if __name__ == "__main__":
    main()

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(n):
  if len(str(i+1))%2==1:
    ans+=1
  else:
    pass
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(str(n-90))
elif keta == 4:
	print(str(909))
elif keta == 5:
	print(str(n-9090))
elif keta == 6:
	print(90909)

Solution (Python):


args = input().split()
N = int(args[0])

count = 0
for i in range(1, N+1):
    num_count = 0
    i = str(i)
    for s in i:
        num_count = num_count + 1
    if num_count % 2 ==0:
        pass
    else:
        count = count + 1

print(count)

Solution (Python):
N = input()
digit = len(N)
N = int(N)
cnt=0
if digit == 1:
    cnt = N
elif digit == 2:
    cnt = 9
elif digit == 3:
    cnt = 9
    cnt += N-100+1
elif digit == 4:
    cnt = 909
elif digit == 5:
    cnt = 909
    cnt += N-10000+1
elif digit == 6:
    cnt = 90909
    
print(cnt)

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

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

Solution (Python):
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''

gi = lambda : list(map(int,input().split()))
n, = gi()
mag = 1
ans = 0
while 1:
	if mag > n:
		break;
	if 10 * mag > n:
		ans += n - mag + 1
		break
	ans += 9 * mag
	mag *= 100
print(ans)

Solution (Python):
N = int(input())
if N < 10:
    print(N)
elif N < 99:
    print(9)
elif N < 1000:
    print(N-(99-10+1))
elif N < 9999:
    print(999 - (99-10+1))
elif N < 100000:
    print(N-(9999-1000+1)-(99-10+1))
else:
    print(N-1-(9999-1000+1)-(99-10+1))

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

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

Solution (Python):
def main():
    n = int(input())
    ans = 0
    for i in range(1, n + 1):
        if i <= 9:
            ans += 1
        elif 100 <= i <= 999:
            ans += 1
        elif 10000 <= i <= 99999:
            ans += 1
        else:
            continue
    print(ans)


if __name__ == '__main__':
    main()

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

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

Solution (Python):

import numpy as np

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

def get_keta(N):
    return len(str(N))

if __name__=='__main__':
    main()

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

keta = len(str(n))

ans = 0

cnt = keta // 2
for i in range(cnt):
    ans += 9 * 10 ** (i*2)
    

if keta % 2 == 0:
    print(ans)
else:
    print(ans + n - 10 ** (keta-1) + 1)

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

if N == 10 ** 5:
    count = 10 ** 5 - 10 ** 4 + 10 ** 3 - 10 ** 2 + 10 - 1
elif N >= 10 ** 4:
    count = N - 10 ** 4 + 1 + 10 ** 3 - 10 ** 2 + 10 - 1
elif N >= 10 ** 3:
    count = 10 ** 3 - 10 ** 2 + 10 - 1
elif N >= 10 ** 2:
    count = N - 10 ** 2 + 1 + 10 - 1
elif N >= 10:
    count = 10 - 1
else:
    count = N

print(count)

Solution (Python):
N=int(input())
tmp=[10**i for i in range(0,6,2)][::-1]
ans=0
for i in tmp:
    if i<=N:
        if N>=i*10:
            ans+=i*9
        else:
            ans+=N-i+1
print(ans)

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): 
    return list(map(int,input().split()))
def m(): 
    return map(int,input().split())
def onem(): 
    return int(input())
def s(x): 
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa == x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): 
    return " ".join(map(str,x))
def max2(x): 
    return max(map(max,x))

n = list(input())

if len(n) == 1:
    k = int("".join(map(str,n)))
    print(k)
elif len(n) == 2:
    print(9)
elif len(n) == 3:
    k = int("".join(map(str,n)))
    print(9 + k -99)
elif len(n) == 4:
    print(909)
elif len(n) == 5:
    k = int("".join(map(str,n)))
    print(9 + 900 + k - 9999)
else:
    print(90909)

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

    for i in range(1,N+1):
        S = str(i)
        s_len = len(S)
        if is_even(s_len) == False:
            count = count + 1
            

    print(count)

def is_even(num):
    if num % 2 == 0:
        return True
    else:
        return False

if __name__ == '__main__' :
    main()

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

if 1 <= N < 10: print(N)
elif 10 <= N < 100: print(9)
elif 100 <= N < 1000: print(9 + N - 100 + 1)
elif 1000 <= N < 10000: print(9 + 900)
elif 10000 <= N < 100000: print(9 + 900 + N - 10000 + 1)
else: print(9 + 900 + 90000)

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

if n < 10:
    ans = n
elif n < 100:
    ans = 9
elif n < 1000:
    ans = n - 100 + 10
elif n < 10000:
    ans = 909
elif n < 100000:
    ans = n - 10000 + 910
elif n == 100000:
    ans = 90909

print(ans)

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

digit = (len(str(N)))


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

Solution (Python):
def hoge(n):
    return 10 ** n - 10 ** (n - 1)

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

ans = 0
for i in range(o):
    if i % 2 == 0:
        continue
    ans += hoge(i)

if o % 2 == 1:
    ans += N - 10 ** (o-1) + 1

print(ans)

Solution (Python):


import copy
import sys


tmp = int(input())

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

print(ans)

Solution (Python):
n=input()

if len(n)==1:
    print(int(n))
elif len(n)==2:
    print(9)
elif len(n)==3:
    print(10+int(n)-100)
elif len(n)==4:
    print(909)
elif len(n)==5:
    print(910+int(n)-10000)
else:
    print(90909)

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

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

Solution (Python):
N = int(input())
s = [9,900,90000]
l = len(str(N))
if l ==6:
    print(sum(s))
elif l == 5:
    print(sum(s[:2])+N-9999)
elif l == 4:
    print(sum(s[:2]))
elif l == 3:
    print(sum(s[:1])+N-99)
elif l == 2:
    print(s[0])
else:
    print(N)

Solution (Python):
n = int(input())
ans = 0
for i in range(n, 0, -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 i < 10:
    cnt += 1
    continue
  if i >= 100 and not (i >= 1000):
    cnt += 1
    continue
  if i >= 10000 and i != 100000:
    cnt += 1
    continue

print(cnt)

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 = input()
tmp = len(N)
ans = 0

for i in range(1, int(N) + 1):
    if i < 10:
        ans += 1
    elif 100 <= i and i <= 999:
        ans += 1
    elif 10000 <= i and i <= 99999:
        ans += 1
print(ans)

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

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

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

while digit>0:
    digit-=2
    ans += 9*10**digit
print(ans)

Solution (Python):
n = input()
l = len(n)
d = [9, 0, 900, 0, 90000, 0, 9000000]
if l % 2 == 0:
    print(sum(d[:l]))
else:
    print(sum(d[:l - 1]) + int(n) - (10 ** (l - 1) - 1))

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

ans = 1
if N < 10:
    ans = N
elif 10 <= N and N < 100:
    ans = 9
elif 100 <= N and N < 1000:
    ans = 9 + (N - 99)
elif 1000 <= N and N < 10000:
    ans = 909
elif 10000 <= N and N < 100000:
    ans = 909 + (N-9999)
elif 100000 <= N and N < 1000000:
    ans = 90909
elif 1000000 <= N:
    ans = 90909 + (N-999999)

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

if len(str(N)) == 1:
    print(N)
if len(str(N)) == 2:
    print(9)
if len(str(N)) == 3:
    print(N-100+1+9)
if len(str(N)) == 4:
    print(909)
if len(str(N)) == 5:
    print(N-10000+1+909)
if len(str(N)) == 6:
    print(90909)

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

Solution (Python):
import math
N = int(input())
ans = 0
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)
elif N < 1000000:
    print(90909)

Solution (Python):
N=input()
A={1:9, 3:900, 5:90000}
l=len(str(N))

ans=0

for i in range(1,l,2):
	ans+=A[i]

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

print ans

Solution (Python):
import sys, math
from collections import deque

readline = sys.stdin.readline

A = int(readline())

n = math.floor(math.log10(A)) + 1

count = 0
for i in range(1, n, 2):
    count += 9 * 10 ** (i - 1)

if n % 2 == 1:
    count += A - 10 ** (n - 1) + 1

print(count)

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

num = len(str(n))
if num==1:
    print(n)
elif num==2:
    print(9)
elif num==3:
    print(n-99+9)
elif num==4:
    print(900+9)
elif num==5:
    print(n-9999+900+9)
else:
    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())
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())
  count = 0
  for i in range(1, n+1):
    count += 1 if len(str(i))%2 == 1 else 0
  print(count)


if __name__ == '__main__':
  main()

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

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

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

if n == 10**5:
    print(90909)
elif n >= 10**4:
    print(909 + (n - 9999))
elif n >= 10**3:
    print(909)
elif n >= 10**2:
    print(9 + (n - 99))
elif n >= 10:
    print(9)
else:
    print(n)

Solution (Python):
n = int(input())
ans = 0
for d in range(1, len(str(n))+1, 2):
    ans += min(10**d-1, n) - 10**(d-1) + 1
print(ans)

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

Solution (Python):
n=input()

k=len(n)//2
l=len(n)%2

ans=0
for i in range(0,2*k,2):
    ans+=9*10**i
if l!=0:
    ans+=int(n)-10**(len(n)-1)+1
print(ans)

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

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

Solution (Python):
N = int(input())
if N<10:
    ans = N
elif 10<=N and N<100:
    ans = 9
elif 100<=N and N<1000:
    ans = 9+(N-100)+1
elif 1000<=N and N<10000:
    ans = 9+900
elif 10000<=N<100000:
    ans = 9+900+(N-10000)+1
else:
    ans = 90909
    
print(ans)

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

Solution (Python):
N = int(input())
if N<100:
    print(min(N,9))
elif N<10000:
    print(9+min(900,N-99))
elif N<=100000:
    print(909+min(90000,N-9999))

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

Solution (Python):
N = int(input())
if 0<N<10:
  num = N
 
if 10<=N<100:
  num = 9
 
if 100<=N<1000:
  num = 9 + N - 99
  
if 1000<=N<10000:
  num = 9 + 900
 
if 10000<=N<100000:
  num = 909 + N - 9999
 
if N==100000:
  num=909+90000
  
print(num)

Solution (Python):
n = input()
l = len(n)
length_list = [9, 0, 900, 0, 90000, 0]
ans = sum(length_list[:l-1])
if l % 2 == 1:
    ans += int(n) + 1 - 10**(l-1)
print(ans)

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

keta = int(math.log10(N) + 1)
res = 0
while True:
    if keta % 2 == 0:
       N = N - (N % 10 ** (keta-1)) - 1
    else:
       res += N - 10 ** (keta - 1) + 1
       N = 10 ** (keta - 1) - 1
    if N <= 0:
        break
    keta = int(math.log10(N) + 1)
print(res)

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

print(cnt)

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

Solution (Python):

N = int(input())
sum = 0

if N >= 9:
  sum += 9
else:
  sum += N % 10

if N >= 999:
  sum += 999-99
elif N >= 100:
  sum += (N-99)%1000

if N >= 99999:
  sum += 99999-9999
elif N >= 10000:
  sum += (N-9999)%100000
  
print("{}".format(sum))

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

if N<10:
    print(N)
elif N<100:
    print(9)
elif N<999:
    print(N-99+9)
elif N<9999:
    print(900+9)
elif N<99999:
    print(N-9999+900+9)
else:
    print(99999-9999+900+9)

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

ans = 0

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

Solution (Python):
N = int(input())
count = 0
a = []
b = []
for i in range(1,N+1,1):
    a.append(i)
for i in range(len(a)):
    if(len(str(a[i]))%2 != 0):
        b.append(a[i])

print(len(b))

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

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

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

Solution (Python):
n = int(input())
if n == 100000:
  print(90909)
elif 1 <= n <= 9:
  print(n)
elif 10 <= n <= 99:
  print(9)
elif 100 <= n <= 999:
  c = n - 99
  print(9 + c)
elif 1000 <= n <= 9999:
  print(909)
elif 10000 <= n <= 99999:
  c = n - 9999
  print(c + 909)

Solution (Python):
n = int(input())
m = n
cnt = 0
while(m != 0):
    cnt += 1
    m = m // 10
ans = 0
if(n < 10):
    print(n)
elif(n < 100):
    print(9)
else:
    if(cnt % 2 == 0):
        k = 0
        while(k<cnt):
            ans += 9*10**k
            k += 2
    else:
        k = 1
        while(k<cnt):
            ans += 9*10**(k-1)
            k += 2
        d = n - 10**(k-1) + 1
        ans += d
    print(ans)

Solution (Python):
import sys

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


if __name__ == "__main__":
    resolve()

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

ans = 0
if len(s) % 2 == 0:
    for i in range(int(len(s)/2)):
        ans += 9 * (10 ** (2 * i))

else:
    for i in range(int((len(s)-1)/2)):
        ans += 9 * (10 ** (2 * i))

    p = n - 10 ** (len(s)-1) + 1
    ans += p

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

Solution (Python):
n = int(input())
res = 0
if n < 10:
    res = n
elif 10 <= n < 100:
    res = 9
elif 100 <= n < 1000:
    res = 9 + (n - 99)
elif 1000 <= n < 10000:
    res = 9 + 900
elif 10000 <= n < 100000:
    res = 9 + 900 + (n - 9999)
elif n == 100000:
    res = 9 + 900 + 90000
print(res)

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

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

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

for i in range(1, 6, 2):
    if 10**i <= n:
        c += 9*10**(i-1)
    else:
        c += max(0, n-10**(i-1)+1)

print(c)

Solution (Python):
import sys

def solve(n):
  count = 0
  for i in xrange(n):
    i += 1
    if 10 <= i < 100:
      continue
    if 1000 <= i < 10000:
      continue
    if 100000 <= i:
      continue

    count += 1

  return count

if __name__ == '__main__':

  n = int(sys.stdin.readline().strip())
  print solve(n)

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

def countDigits(x):
    return len(str(abs(x)))

count = 0
for i in range(1, a + 1):
    if((countDigits(i) % 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))
elif n == 100000:
    print(90909)

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

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(9 + 900)
elif 10000 <= n < 100000:
    print(9 + 900 + n - 9999)
else:
    print(9 + 900 + 90000)

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

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

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

while i!=n+1:
    if (1<=i and 9>=i):

        ans+=1
    if (100<=i and 999>=i):

        ans+=1
    if (10000<=i and 99999>=i):
        ans+=1

    i+=1


print(ans)

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

if N <= 9:
    print(N)
elif 10 <= N and N <= 99:
    print(9)
elif 100 <= N and N <= 999:
    print(9+N-100+1)
elif 1000 <= N and N <= 9999:
    print(9+900)
elif 10000 <= N and N <= 99999:
    print(9+900+N-10000+1)
else:
    print(9+900+90000)

Solution (Python):

n = int(input())

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

print(cnt)

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

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(909)
elif n<100000:
    print(9+900+n-10000+1)
else:
    print(90909)

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

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

if N%2 == 0:
    N = N-2
    while(N>=0):
        count = count + 9*(10**N)
        N = N-2
else:
    count = count + n-(10**(N-1))+1
    N = N-3
    while(N>=0):
        count = count + 9*(10**N)
        N = N-2 

print(count)

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

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

count = 0

for i in range(N+1):
    if 0 < i and i < 10:
        count+=1
    elif 99<i and i<1000:
        count+=1
    elif 9999<i and i<100000:
        count+=1
    else:
        continue

print(count)

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

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


def fun(N):
    c=0
    for i in range(1,N+1):
        if len(str(i)) % 2 != 0:
            c+=1
    return c

print(fun(N))

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

t = 1
u = 10
res = 0
while t <= n:
    t += 1
    res += 1
    if t % u == 0:
        t *= 10
        u *= 100

print(res)

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

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

print(s)

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

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

Solution (Python):
n = int(input())
if n<10:
    print(n)
elif n<100:
    print(9)
elif n<1000:
    print(n-(99-9))
elif n<10000:
    print(999-(99-9))
elif n<100000:
    print(n-(9999-999)-(99-9))
elif n==100000:
    print(99999-(9999-999)-(99-9))

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+900+n-9999)
elif l==6:
    print(9+900+90000)

Solution (Python):
import numpy as np

N = input()
N = int(N)
stN = str(N)
count = 0
if(len(stN)==6):
    count = 90909
elif(len(stN)==5):
    count = (N-10000+1)+909
elif(len(stN)==4):
    count = 909
elif(len(stN)==3):
    count = (N-100+1)+9
elif(len(stN)==2):
    count = 9
else:
    count = N
print(count)