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



Sample input:
11


Sample output:
9

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 0
for i in range(1,n+1):
    if (i//10)%2 == 1:
        a += 1

print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

dig = len(str(N))

dig_odd = math.floor(dig / 2)

A = 0

for i in range(dig_odd):
  A += 9 * 10 ** (2 * i)

if dig % 2 == 1 and dig > 1:
  A += int(str(N)[1:]) + 1
elif dig == 1:
  A = N
  
print(A)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

dig = len(str(N))

dig_odd = math.floor(dig / 2)

A = 0

for i in range(dig_odd):
  A += 9 * 10 ** (2 * i)

if dig % 2 == 1 and dig_odd >= 1:
  A += int(str(N)[1:]) + 1
elif dig == 1:
  A = N
  
print(A)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
N=int(input())
ans=0
if N<=9:
  ans=N
elif 10<=N<=99:
  ans=10
elif 100<=N<=999:
  ans=9+(N-99)
elif 1000<=N<=9999:
  ans=909
elif 10000<=N<=99999:
  ans=909+(N-9999)
else:
  ans=90909
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if N<10:
    print(N)
elif N<100:
    print(9)
elif N<1000:
    print(N-90)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
N=int(input())

M=str(N)
n=len(M)

ans=0
if n==1:
  ans=N
if n==2:
  ans=(10**1-1)
if n==3:
  ans=(10**1-1)+(N-10**2+1)
if n==4:
  ans=(10**1-1)+(10**3-1-10**2+1)
if n==5:
  ans=(10**1-1)+(N-10**3+1)
if n==6:
  ans=(10**1-1)+(10**3-1-10**2+1)+(10**5-1-10**4+1)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0
if n < 10:
  sum = n
else:
  sum += 9
if 100 <= n:
  if n < 1000:
    sum += n-99
  else:
    sum += 900
if 10000 < n:
  sum += n - 9999

print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0
if n < 10:
  sum = n
else:
  sum += 9
if 100 <= n:
  if n < 1000:
    sum += n-99
  else:
    sum += 900
if 10000 <= n:
  sum += n - 9999
print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N in range(1,10):
  print(N)
elif N in range(11, 100):
  print(9)
elif N in range(100, 1000):
  print(9+(N-100+1))
elif N in range(1000, 10000):
  print(9+900)
elif N in range(10000, 100000):
  print(9+900+(N-10000+1))
elif N == 100000:
  print(9+900+90000)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N in range(1,10):
  print(N)
elif N in range(11, 100):
  print(9)
elif N in range(101, 1000):
  print(9+(N-100+1))
elif N in range(1001, 10000):
  print(9+900)
elif N in range(10001, 100000):
  print(9+900+(N-10000+1))
elif N == 100000:
  print(9+900+90000)

Submission status: Wrong Answer

Solution code:
#coding: utf-8

N = input()

if(len(N) % 2 == 1):
    a = 10 ** (len(N) - 1)
    num = int(N) % a

    if(a == 10000):
        count = 909
    elif(a == 100):
        count = 10
    else:
        count = 9

    count += num
    print(count)
else:
    a = 10 ** (len(N) - 1)
    num = int(N) - int(N) % a
    if (num == 100000):
        count = 90909
    elif(num == 1000):
        count = 908
    else:
        count = 9
    print(count)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())

if n < 10:
    ans = n
elif n < 100:
    ans = 9
elif n < 1000:
    ans = 9 + n%100 + math.floor(n/100)
elif n < 10000:
    ans = 9 + 900 + math.floor(n/100)
elif n < 100000:
    ans = 9 + 900 + n%1000 + math.floor(n/1000)
elif n == 100000:
    ans = 9 + 900 + 90000
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 10:
    ans = n
elif n < 100:
    ans = 9
elif n < 1000:
    ans = 9 + 1 + n%100
elif n < 10000:
    ans = 9 + 900
elif n < 100000:
    ans = 9 + 900 + 1 + n%1000
elif n == 100000:
    ans = 9 + 900 + 90000
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n  = int(input())
if n<10:
    print(n)
elif n<1000:
    print(n-90)
elif n<100000: 
    print(n-8990)
else:
    print(90909)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = str(int(input()))
i = 1
total = 0
digits = [i for i in range(len(N)) if i != 0 and i % 2 != 0]

for digit in digits:
    total += int("9" * digit) - int("1" + "0" * (digit - 1)) + 1
    if len(N) % 2 != 0:
        total += int(N) - int(str(1) + (len(N)-1)*"0") + 1

print(total)

Submission status: Wrong Answer

Solution code:
N = input()
i = 1
total = 0
digits = [i for i in range(len(N)) if i != 0 and i % 2 != 0]

for digit in digits:
    total += int("9" * digit) - int("1" + "0" * (digit - 1)) + 1
    if len(N) % 2 != 0:
        total += int(N) - int(str(1) + (len(N)-1)*"0") + 1

print(total)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
for i in range(1, 6):
    # 10,1000,100000
    if i % 2 == 1:
        if n < 10 ** i:
            count += n - 10 ** (i-1) + 1
            print(count)
            exit()
        else:
            count += 10 ** i - (10**(i-1))
            #print('b', i, count)
    else:
        if n < 10 ** i:
            print(count)
            exit()

Submission status: Wrong Answer

Solution code:
n = input()
l = len(n)
count = 0

if l == 1:
  print(int(n))
else:
  for i in range(1, l, 2):
    count += 9 * 10 ** (i-1)

  if l % 2 == 1:
    count += int(n[1:]) + 1

  print(count)

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s)
b=0
if a<100:
  b=9
elif 100<=a<1000:
  b=a-90
elif 1000<=a<10000:
  b=909
elif 10000<=a<100000:
  b=a-9090
elif a==100000:
  b=90909
print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
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:90909

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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 < 1000000):
        print(9 - 99 + 999 - 9999 + n)
    else:
        print(9 - 99 + 999 - 9999 + 99999)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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 - 100 + 9)
    elif(10000 <= n < 1000000):
        print(9 - 99 + 999 - 9999 + n)
    else:
        print(9 - 99 + 999 - 9999 + 99999)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

def main():
    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(999 - 100 + 9)
    elif(10000 < n < 99999):
        print(9 - 99 + 999 - 9999 + n)
    else:
        print(9 - 99 + 999 - 9999 + 99999)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans=0
for i in range(N):
    if i>0 and math.ceil(math.log10(i))%2==1 :
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
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 <10000:
    print(n-9090)
else:
    print(90909)

Submission status: Wrong Answer

Solution code:
N = input()

ans = -1
keta = len(N)
N = int(N)

top = N - 10**(keta-1)
odd = keta//2

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

if keta%2 == 1:
    ans += top+1
print(ans)

Submission status: Wrong Answer

Solution code:
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+=1000
if(d>5): ans+=100000
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = 0;aux = n
while(aux>0):
  aux//=10
  d+=1
ans = 0
if(d&1): ans+= d-10**(d-1)+1
if(d>1): ans+=10
if(d>3): ans+=1000
if(d>5): ans+=100000
print(ans)

Submission status: Wrong Answer

Solution code:
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(900)
elif len(n_str) == 5:
    print(9+900+n-9999)
else:
    print(9+900+90000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
if len(n) == 1:
  print(int(n))
elif len(n) <= 3:
  print(int(n)%100 + 10)
elif len(n) <= 5:
  print(int(n)%10000 + 1010)
else :
  print(909090)

Submission status: Wrong Answer

Solution code:
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
    print(x)
    exit()
else:
  if p==0:
    print(0)
    exit()
  else:
    x = 0
    a = 9
    while(p>1):
      x += a
      a *= 100
    print(x)
    exit()

Submission status: Wrong Answer

Solution code:
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(999) if 1000<=n<=9999 else print(n-9090) if 10000<=n<=99999 else print(90909)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
l = [9, 0, (10**3) - (10**2), 0, (10**5) - (10**4), 0]
a = sum(l[:len(n) - 1]) + (int(n[-(len(n) - 1):]) + 1 if len(n) % 2 != 0 else 0)
print(a - 1 if int(n) < 10 else a)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
total = 0
val1 = int(math.ceil(math.log(n,10)))
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
if val1==math.log(n,10) and val1%2:
	print(ans-1)
else:
	print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
if 1 <= N <= 99:
	print(9)
elif 100 <= N <= 999:
	print(N-100+1+9)
elif 1000 <= N <=9999:
	print(9+900)
elif 10000 <= N <= 99999:
	print(N-10000+1+9+900)
else:
	print(90909)

Submission status: Wrong Answer

Solution code:
N = int(input())
if 1 <= N <= 99:
	print(9)
elif 100 <= N <= 9999:
	print(N-100+1+9)
elif 10000 <= N <=99999:
	print(N-10000+1+9+1000)
else:
	print(90909)

Submission status: Wrong Answer

Solution code:

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

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:

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

ans = 0

#1桁より大きい
if len_N > 1:
    ans += 9
#2以下の桁のとき
elif len_N <= 2:
    ans += N
#3桁より大きい
elif len_N > 3:
    ans += (10**3 -1) - 10 ** 2 + 9
#3以下の桁のとき
elif len_N <= 3:
    ans += N - (10 ** 2 -1) + 9

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

    
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 a==0:
	if b==0:
		if c==0:
			if d==0:
				print(n)
			else:
				print(9)
		else:
		 print(n-90)
	else:
		print(909)

if n==100000:
	print(90909)

else:
	print(n-9090)

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
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-10000)
elif(3<s):
    print(909)
elif(3<=s):
    print(9+N-99)
elif(2<=s):
    print(9)
else:
    print(N)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

#5桁 3桁 1桁な n 以下の数をカウント

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

Submission status: Wrong Answer

Solution code:
n = int(input())

print(n//2)

Submission status: Wrong Answer

Solution code:
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*(10**(i))
    sum += N - 10**(t-1) + 1
    print(sum)

Submission status: Wrong Answer

Solution code:
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*(10**(i))
    print(sum)
else:
    for i in range((t-1)//2):
            sum += 9*(10**(i))
    sum += N - 10**(t-1) + 1
    print(sum)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf8 -*-

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 10:
    print(len([0]*n))

elif n < 100:
    print(9)
elif n < 1000:
    print(9 + len([0]*(n-100+1)))
elif n < 10000:
    print(9+999-100+1)
elif n < 100000:
    print(9+999-100+1 + len([0]*(n-10000+1)))
elif n == 1000000:
    print(90909)

Submission status: Wrong Answer

Solution code:
N = input()
#N = "100000"

ans = 0
digit = len(N)
if digit == 1:
    print(N)
else:
    if digit % 2 != 0:
        n = int(N[0])
        ans = int(N[1:]) + (n-1) * 10**digit + 1
    else:
        ans = 0
    digit -= 1

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

Submission status: Wrong Answer

Solution code:
N = input()
#N = "100000"

ans = 0
digit = len(N)
if digit > 1:
    if digit % 2 != 0:
        n = int(N[0])
        ans = int(N[1:]) + (n-1) * 10**digit + 1
    else:
        ans = 0
    digit -= 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

if n >= 10:
  ans += 10
  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 + 1

print(ans)

Submission status: Wrong Answer

Solution code:
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)
else:
    print(910)

Submission status: Wrong Answer

Solution code:
N = int(input())

result = 0
if N > 10:
    result += 9
else:
    result += N

if N >= 1000:
    result += 900
elif N >= 100:
    result += N - 99


if N >= 100000:
    result += 90000
elif N >= 10000:
    result += N - 9999

print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
rank = len(str(n))
first = int(str(n)[0])

ans = 0

for i in range( rank ):
    if i % 2 != 0:
        ans += 9 * 10 ** (i-1)
if rank % 2 != 0:
    ans += ( first - 1 ) * (10 ** rank)
    ans += n - first * ( 10 ** rank ) + 1
print ( ans )

Submission status: Wrong Answer

Solution code:
n = int(input())
rank = len(str(n))
first = int(str(n)[0])

print( rank )
ans = 0

for i in range( rank ):
    if i % 2 != 0:
        print( i )
        ans += 9 * 10 ** (i-1)
if rank % 2 != 0:
    ans += ( first - 1 ) * (10 ** rank)
    ans += n - first * ( 10 ** rank ) + 1
print ( ans )

Submission status: Wrong Answer

Solution code:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    elif b == 3:
        d = '9' * (b // 2)
        d = '0'.join(d)
        d = int(d + '0')
        print(c - d)
    elif b > 3:
        d = '9' * (b // 2)
        d = '0'.join(d)
        d = int(d + '1')
        print(c - d)

Submission status: Wrong Answer

Solution code:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    elif b == 3:
        d = '9' * (b // 2)
        d = '0'.join(d)
        d = int(d + '0')
        print(c - d)
    elif b > 3:
        d = '9' * (b // 2)
        d = '0'.join(d)
        d = int(d + '1')
        print(d)
        print(c - d)

Submission status: Wrong Answer

Solution code:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    elif b == 3:
        d = '9' * (b // 2)
        '0'.join(d)
        d = int(d + '0')
        print(c - d)
    elif b > 3:
        d = '9' * (b // 2)
        '0'.join(d)
        d = int(d + '1')
        print(c - d)

Submission status: Wrong Answer

Solution code:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    elif b == 2:
        d = '9' * (b // 2)
        '0'.join(d)
        d = int(d + '0')
        print(c - d)
    elif b > 2:
        d = '9' * (b // 2)
        '0'.join(d)
        d = int(d + '1')
        print(c - d)

Submission status: Wrong Answer

Solution code:
a = input()
b = len(list(a))
c = int(a)
d = ''

if b % 2 == 0:
    d = '9' * (b // 2)
    print('0'.join(d))

else:
    if b == 1:
        print(a)
    else:
        d = '9' * (b // 2)
        '0'.join(d)
        d = int(d + '0')
        print(c - d)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
if n >= 10:
    ans += 9
if n >= 1000:
    ans += 900
if n >= 100000:
    ans += 90000

if n < 1000 and n >= 100:
    ans += n - 100 + 1

if n < 100000 and n >= 10000:
    ans += n - 10000 + 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

if N>=10:
    result=9
elif N<10:
    result=N

if N>=1000:
    result+=899
elif 100<=N and N<1000:
    result+=N-100+1

if N>=100000:
    result+=89999
elif 10000<=N and N<100000:
    result+=N-10000+1

print(result)

Submission status: Wrong Answer

Solution code:
N=int(input())
result=0
if N>=10:
    result=9
else:
    result=N

if N>=1000:
    result+=899
elif 100<=N and N<1000:
    result+=N-100+1

if N>=100000:
    result+=89999
elif 10000<=N and N<100000:
    result+=N-10000+1

print(N)

Submission status: Wrong Answer

Solution code:
n = int(input())
length = len(str(n))

res = 0
if length == 1:
    print(n)
elif length == 2:
    print(9)
elif length == 3:
    print(9 + n - 99)
elif length == 4:
    print(900 + 9)
else:
    print(90000 + 900 + 9)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = N
res = 0

while N >= 1:
  N /= 10
  res += 1
  
res -= 1

ans -= 10**res

for i in range(res-1):
  ans += 10**(i+1)
  

  
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

res = 0

while N >= 1:
  N /= 10
  res += 1
  
res -= 1

ans = N - 10**res

for i in range(res-1):
  ans += 10**i
  
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
length = len(str(n))

res = 0
if length == 1:
    print(n - 1)
elif length == 2:
    print(9)
elif length == 3:
    print(9 + n - 99)
elif length == 4:
    print(900 + 9)
else:
    print(90000 + 900 + 9)

Submission status: Wrong Answer

Solution code:
n = int(input())
length = len(str(n))

a = [9, 899]
res = 0
if length == 1:
    print(n - 1)
elif length == 2:
    print(9)
elif length == 3:
    print(9 + n - 99)
elif length == 4:
    print(899)
else:
    print(1 + 899 + 9)

Submission status: Wrong Answer

Solution code:
Na = int(input())
if 9 >= Na:
  Na2 = Na
  print(Na)
elif 99 >= Na:
  Na2 = 9
  print(Na2)
elif 100>= Na:
  Na2 = Na - 90
elif 9999>= Na:
  Na2 = 9090
elif 99999>= Na:
  Na2 = Na - 9090

Submission status: Wrong Answer

Solution code:
N = input()

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

if len(N) % 2 != 0:
    ans += int(N) - 10 ** (len(N) - 1)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
o = len(str(N))
mod = N%(10**(o-1))

ans = 0
for i in range(1,o):
    if i%2 == 1:
        ans += 10**i - 10**(i-1)
if o%2 ==1:
    ans += mod+1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
digits=len(str(n))
cnt=0
for i in range(int(digits/2)):
  cnt+=9*(10**(i*2))
cnt+=n-10**(digits-1)+1
print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=n
if n>99: ans=n-90
if n>9999: ans=n-9000-90
if n>99999: ans=90909
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
#A=list(map(int,input().split()))
#b=list(map(int,input().split()))
#s=[input() for _ in range(n)]
ans=0
for i in range(1,n+1):
        if len(str(i))==1:
                ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
#n=int(input())
#A=list(map(int,input().split()))
#b=list(map(int,input().split()))
#s=[input() for _ in range(n)]
n=list(input())
m=len(n)
a="".join(n[:])
a=int(a)
ans=0
if m%2==0:
        for i in range(0,m-1,2):
                ans+=9*(10**i)
else:
        for i in range(0,m-2,2):
                ans+=9*(10**i)
                ans+=a-10**(m-1)+1
print(ans)

Submission status: Wrong Answer

Solution code:
#n=int(input())
#A=list(map(int,input().split()))
#b=list(map(int,input().split()))
#s=[input() for _ in range(n)]
n=list(input())
m=len(n)
a="".join(n[:])
a=int(a)
ans=0
if m%2==0:
        for i in range(0,m-1,2):
                ans+=9*(10**i)
else:
        for i in range(0,m-1,2):
                ans+=9*(10**i)
                ans+=a-10**(m-1)+1
print(ans)

Submission status: Wrong Answer

Solution code:
#n=int(input())
#A=list(map(int,input().split()))
#b=list(map(int,input().split()))
#s=[input() for _ in range(n)]
n=list(input())
m=len(n)
a="".join(n[:])
a=int(a)
ans=0
for i in range(0,m-2,2):
        ans+=9*(10**i)
if m%2==1:
         ans+=a-10**(m-1)+1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
if n>=99999 :ans+=n%100000+1+900+9
elif n>=999 :ans+=n%1000+1+9
elif n>=9 :ans+=n%10
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
ans+=n%10
ans+=n%1000+1
ans+=n%100000+1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
odd = []
for i in range(1, n):
    if len(str(i)) % 2 == 1:
        odd.append(i)
print(len(odd))

Submission status: Wrong Answer

Solution code:
N = input()
ans = 0
if len(N) % 2 == 0:
    a = len(N) - 1
    for i in range(1, a+1, 2):
        ans += 9*(10**(i-1))
else:
    a = len(N) - 2
    for i in range(1, a+1, 2):
        ans += 9*(10**i)
    ans += int(N) - 10**(len(N)-1) + 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if 10000<=N<=99999:
  print(N-9999+900+9)
elif 1000<=9999:
  print(909)
elif 100<=N<=999:
  print(N-99+9)
elif 10<=N<=99:
  print(9)
elif N==100000:
  print(90909)
else:
  print(N)

Submission status: Wrong Answer

Solution code:
N = int(input())
if 10000<=N<=99999:
  print(N-9999+900+9)
elif 100<=N<=9999:
  print(N-99+9)
elif N<=99:
  print(9)
elif N==100000:
  print(90909)
else:
  print(N)

Submission status: Wrong Answer

Solution code:
N = int(input())
if 10000<=N:
  print(N-9999+900+9-1)
elif 100<=N<=9999:
  print(N-99+9)
elif 10<=N<=99:
  print(9)
else:
  print(N)

Submission status: Wrong Answer

Solution code:
N = int(input())
if 10000<=N:
  print(N-9999+900+9-1)
elif 100<=N<=9999:
  print(N-99+9)
elif N<=99:
  print(9)
else:
  print(N)

Submission status: Wrong Answer

Solution code:
n=input()
dig=len(n)
n=int(n)
ans=0

if dig%2==1:
    ans=n+1-10**(dig-1)
    dig-=2
    while dig>2:
        ans+=9*10**(dig-1)
        dig-=2 
else:
    dig-=1
    while dig>2: 
        ans+=9*10**(dig-1)
        dig-=2

ans+=9

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n // 100000 == 1:
    print(90909)
elif n // 10000 > 0:
	print(n - 10000 -100 + 1000 + 9+1)
elif n // 100 > 1:
	print(n - 100 + 1 +9)
else:
	print(min(n,9))

Submission status: Wrong Answer

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

print(n)

Submission status: Wrong Answer

Solution code:
n=int(input())
print(n//2+n%2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
N =int( input())

#Nが1桁の場合
if(N<10):
    print(N)
    sys.exit()
#Nが2桁の場合
if(N<100):
    print(9)
    sys.exit()
#Nが3桁の場合
if(N<1000):
    print(N-90)
    sys.exit()
#Nが4桁の場合
if(N<10000):
    print(1009)
    sys.exit()
#Nが5桁の場合
if(N<100000):
    print(N-9090)
    sys.exit()
if(N==100000):
    print(90909)
    sys,exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

const10000 = 90000
const100   = 900
const1     = 9

if 100000 == N:
    print(90909)
elif 10000 <= N:
    div10000, mod10000 = divmod(N,10000)
    res = const100 + const1 + (div10000-1)*10000 + mod10000 + 1
    print(res)
elif 100 <= N:
    div100, mod100 = divmod(N,100)
    res = const1 + (min(10,div100)-1)*100 + mod100 + 1
    print(res)
elif 10 <= N:
    print(const1)
else:
    print(N)

Submission status: Wrong Answer

Solution code:
n = int(input())
odd = []
for i in range(1, n):
    if len(str(i)) % 2 == 1:
        odd.append(i)
print(len(odd))

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
for i in range(1,N+1):
  ks=len(str(i))
  if ks!=2 and ks!=4:
    count=count+1
print(count)