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

100,000

ct = 0

if n <= 9:
	ct = n
elif n <= 999 and n >= 10:
	ct = 9 + (n - 99)
elif n <= 99999 and n >= 1000:
	ct = 9 + 900 + (n - 9999)
elif n == 100000:
	ct = 90909
	
print(ct)

Submission status: Wrong Answer

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

a = 0
if digit % 2 == 0:
  while digit > 0:
    if digit % 2 != 0:
      a += 10 ** digit - 10 ** (digit-1) 
      print(a)
    digit -= 1
else:
  digit -= 1
  a += n - 10 ** (digit) + 1
  print(a)
  while digit > 0:
    if digit % 2 != 0:
      a += 10 ** digit - 10 ** (digit-1) 
    digit -= 1

print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = int(0)

if n < 10:
  ans = n
if 100 > n and n >= 10:
  ans = 9
if 1000 > n and n >= 100:
  ans = n-90
if 10000 > n and n >= 1000:
  ans = 909
if 100000 >= n and n >= 10000:
  ans = n-9090

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
s=len(str(n))
c=0

for i in range(s-1):
    if i%2==1:
        c+=9*10**(s-i-2)
if s%2==0:
    print(c)
else:
    c+=n-10**(s-1)+1
    print(c)

Submission status: Wrong Answer

Solution code:
N=int(input())

if N<10:
    print(N)
elif 10<=N and N<100:
    print(9)
elif N<=100 and N<1000:
    print(9+(N-99))
elif N<=1000 and N<10000:
    print('909')
elif N<=10000 and N<100000:
    print(909+(N-9999))
elif N==100000:
    print(90000+900+9)

Submission status: Wrong Answer

Solution code:
number = list(input())

n = len(number) // 2
ans = 0
underNum = ''

if n == 0:
  ans = int(number[0])
else:
  ans = 9
  for i in range(3, len(number)+1):
    if i == len(number) and i % 2 != 0:
      for j in range(1, i):
        underNum += number[j]
      ans += int(underNum) + 1
    elif i % 2 != 0:
      ans += 9 * 100 ** (i // 2)
      
print(ans)

Submission status: Wrong Answer

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


  
print(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l=[9,900,90000,900000]
n=int(input())
ld=len(str(n))
if ld==1:
  c=0
  for i in range(n):
    if i%2!=0:
      c+=1
  print(c)
elif ld==2:
  print(l[0])
elif ld==3:
  print(l[0]+(n-100)+1)
elif ld==4:
  print(l[0]+l[1])
elif ld==5:
  print(l[0]+l[1]+(n-10000)+1)
elif ld==6:
  print(l[0]+l[1]+l[2])

Submission status: Wrong Answer

Solution code:
n=int(input())
if n < 10:
	print(n)
else:
	erg = 0
	if len(str(n)) % 2 == 1:
		erg += 1 + n % (10** (len(str(n))-1))
	for k in range(1, len(str(n)), 2):
		erg += 10**k - (10**(k-1))
	print(erg)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<10:
  print(N)
elif N<100:
  print(9)
elif N<1000:
  print(N-91)
elif N<10000:
  print(909)
elif N<100000:
  print(N-9091)
else:
  print(90909)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<10:
  print(N)
elif N<100:
  print(9)
elif N<1000:
  print(N-91)
elif N<10000:
  print(908)
elif N<100000:
  print(N-9092)
else:
  print(101007)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<10:
  print(N)
elif N<100:
  print(9)
elif N<1000:
  print(N-91)
elif N<10000:
  print(908)
else:
  print(909)

Submission status: Wrong Answer

Solution code:
n = int(input())
 
exp = 1000
expMin = 100
 
result = min(9, n)
while n > exp:
  result += (exp - expMin - 1)
  expMin = exp * 10
  exp = exp * 100
  
remainder = n - expMin
if remainder >= 0:
  result += remainder + 1
  
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
 
exp = 1000
expMin = 100
 
result = min(9, n)
while n >= exp:
  result += (exp - expMin - 1)
  expMin = exp * 10
  exp = exp * 100
  
remainder = n - expMin
if remainder >= 0:
  result += remainder + 1
  
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
 
exp = 1000
expMin = 100
 
result = 9
while n > exp:
  result += (exp - expMin - 1)
  expMin = exp * 10
  exp = exp * 100
  
remainder = n - expMin
if remainder >= 0:
  result += remainder + 1
  
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())

exp = 1000
expMin = 100

result = 9
while n > exp:
  result += (exp - expMin - 1)
  expMin = exp * 10
  exp = exp * 100
  
remainder = n - expMin
if remainder > 0:
  result += remainder
  
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
cou = 0
for i in range(n, 1):
    if not i%2:
        cou+=1
print (cou)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
cou = 0
for i in range(n+1):
    if not i%2:
        cou+=1
print (cou)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=a//10+1
c=a%10
d=b//2+1
print(int(d*9+c))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

for i in range(N+1):
  a = str(i)
  if len(a)/2 != 0:
    ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = str(input())
a = 0
for dig in range(0, len(n)-1, 2):
    a = a + 9*(10**dig)

if (len(n) % 2)and(len(n) > 1):
    a = a + int(n[1:]) + 1
elif len(n) == 1:
    a = int(n)

print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())

def keta(N):
    ten = 1
    for i in range(1, 8):
        if N/ten < 1:
            break
        ten = ten*10
    return i-1
        
if keta(N)==1:
    ans = N
elif keta(N)==2:
    ans = 9
elif keta(N)==3:
    ans = 9 + N-99
elif keta(N)==4:
    ans = 909
elif keta(N)==5:
    ans = 1009 + N-9999
elif keta(N)==6:
    ans = 90909

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def keta(N):
    ten = 1
    for i in range(1, 8):
        if N/ten < 1:
            break
        ten = ten*10
    return i-1
        
if keta(N)==1:
    ans = N
elif keta(N)==2:
    ans = 9
elif keta(N)==3:
    ans = 9 + N-99
elif keta(N)==4:
    ans = 909
elif keta(N)==5:
    ans = 1009 + N-9999
elif keta(N)==6:
    ans = 90909

print(keta(N))
print(ans)

Submission status: Wrong Answer

Solution code:
s = int(input())
 
if s < 100:
  print(min(s,9))
elif s < 10000:
  print(min(9+s,908))
elif s < 1000000:
  print(min(908+s,90909))

Submission status: Wrong Answer

Solution code:
N = int(input())
if 1 <= N and N < 10:
    ans = N
if 10 <= N  and N < 100:
    ans = 9
if 100 <= N and N < 1000:
    ans = 9 + N - 99
if 1000 <= N and N < 10000:
    ans = 999 - 100 + 1
if 10000 <= N and N < 100000:
    ans = 9 + (999 - 100 + 1) + N - 9999
if N == 100000:
    ans = 9 + (999 - 100 + 1) + N - 9999 - 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
if 1 <= N and N < 10:
    ans = N
if 10 <= N  and N < 100:
    ans = 9
if 100 <= N and N < 1000:
    ans = 9 + N - 99
if 1000 <= N and N < 10000:
    ans = 999 - 100 + 1
if 10000 <= N and N <= 100000:
    ans = 9 + (999 - 100 + 1) + N - 9999 - 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
n = int(N)

if len(N) <= 1:
	print(n)
elif len(N) <= 2:
	print(9)
elif len(N) <= 3:
	print(9+n-99)
elif len(N) <= 4:
	print(9+999-99)
else:
	print(90909)

Submission status: Wrong Answer

Solution code:
num = int(input())
num_digit = len(str(num))

if num_digit == 1:
    print(0)
elif num_digit == 2:
    print(9)
elif num_digit == 3:
    print(9 + (num - 100 + 1))
elif num_digit == 4:
    print(909)
elif num_digit == 5:
    print(909 + (num - 10000 + 1))
elif num_digit == 6:
    print(90909)

Submission status: Wrong Answer

Solution code:
n = int(raw_input())

list_n = list(range(1,n+1))
print(list_n)

cnt = 0
for i in list_n:
     if (len(str(i)))%2 == 1:
            cnt += 1
     else: pass
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
counter =0

for i in range(N):
    if(len(str(i)) % 2 == 1):
        counter += 1
    else:
        pass

print(counter-1)

Submission status: Wrong Answer

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

if( N // 10 > 0):
    ans+=9
else:
    ans+= N

q = N // 100
if(q >= 10):
    ans+= 900
elif(q>=1):
    ans+=(N % 100)+1
    ans+=((N//100)-1)*100

q = N // 10000
if(q >= 100):
    ans+= 90000
elif(q>=1):
    ans+=(N % 10000)
    ans+=((N//10000)-1)*10000
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:
a = int(input())

sum=0
i=0

while i<len(str(a)):
  j=str(a)[-i:]
  sum=sum+int(j)+1
  i=i+2

Submission status: Wrong Answer

Solution code:
N = int(input())
str_N = str(N)
if len(str_N)%2 == 0:
  ans1 = 10 ** (len(str_N) -1) -1
  print(ans1)
if len(str_N)%2 == 1:
  ans2 = 10 ** (len(str_N) -2) -1 + (N - 10 ** (len(str_N) -1) + 1)
  print(ans2)

Submission status: Wrong Answer

Solution code:
N = int(input())
i = len(str(N))
r = 0

if i==1:
  r = N
elif i==2:
  r = 9
elif i==3:
  r = 9 + (N-100+1)
elif i==4:
  r = 9 + (999-100+1)
elif i==5:
  r = 9 + (999-100+1) + (N - 10000 + 1)
elif i==6:
  r = 9 + (999-100+1) + (9999 - 10000 + 1)
print(r)

Submission status: Wrong Answer

Solution code:
N = int(input())
i = len(str(N))
r = 0
if i==0:
  r = 0
if i==1:
  r = N
elif i==2:
  r = 9
elif i==3:
  r = 9 + (N-100+1)
elif i==4:
  r = 9 + (999-100+1)
elif i==5:
  r = 90909
else:
  r = 0
print(r)

Submission status: Wrong Answer

Solution code:
N = int(input())
i = len(str(N))
r = 0
if i==1:
  r = N
elif i==2:
  r = 9
elif i==3:
  r = 9 + (N-100+1)
elif i==4:
  r = 9 + (999-100+1)
else:
  r = 90909
print(r)

Submission status: Wrong Answer

Solution code:
N = input()

num = len(N)
top = int(N[0])
N = int(N)

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

ans += int(10**(num-1)-1 - 10/11 * (100**((num-2)/2)-1))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
print(90000*(bool(N//100000))+9*(bool(N//10))+900*(bool(N//1000))+(N-99)*(bool(N//100)-bool(N//1000))+(N-9999)*(bool(N//10000)-bool(N//100000)))

Submission status: Wrong Answer

Solution code:
p = 10
N = int(input())
r = 0
while N>p**(2*r):
    r += 1
r -= 1
if N < p**(2*r+1):
    print(N-p**(2*r) + 1 + (p**(2*r)-1)//(p+1))
else:
    print((p**(2*(r+1))-1)//(p+1))

Submission status: Wrong Answer

Solution code:
import glob

#IS_TEST = 1

# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\136\\B'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            return self.problem[self.index]
            self.index += 1
        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                self.initialize(path)
                self.resolve()
        except NameError:
            self.resolve()


class B(Common):

    def resolve(self):

        n = int(self.input_data())
        digits = len(str(n))
        result = 0
        if digits % 2 != 0:
            result += n % (10 ** digits) + 1
        for i in range(1, digits):
            if i % 2 == 0:
                continue
            else:
                result += 10 ** (i-1) * 9

        print(str(result))



solver = B(REL_PATH)
solver.exec_resolve()

Submission status: Wrong Answer

Solution code:
n = int(input())
if n==10**5:
    print('90909')
elif n > 10000:
    print(str(910 + n-10000))
elif n > 1000:
    print('909')
elif n > 100:
    print(str(10 + n-100))
elif n > 10:
    print('9')
else:
    print(str(n))

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt = 0

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

print(cnt)

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())
length = len(str(n))
ans = 0

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N == 10**5:
  print("90909")
elif N >= 10**4:
  resid=N-10**4+1
  print(str(9+900+resid))
elif N >= 10**3:
  print("990")
elif N >= 10**2:
  resid=N-10**2+1
  print(str(9+resid))
elif N >= 10:
  print("9")
else:
  print(str(N))

Submission status: Wrong Answer

Solution code:
N=int(input())
if N >= 10**4:
  resid=N-10**4+1
  print(str(9+900+resid))
elif N >= 10**3:
  print("990")
elif N >= 10**2:
  resid=N-10**2+1
  print(str(9+resid))
elif N >= 10:
  print("9")
else:
  print(str(N))

Submission status: Wrong Answer

Solution code:
import math

n = input()

digits = len(n)
count = 0


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

    return int(c * 9)


if digits % 2 == 0:
    count += even_count(digits)
else:
    if digits - 1 != 0:
        count += even_count(digits - 1)
    count += int(n) - 10**(digits - 1)
    if digits != 1:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
a = input()
l = len(a)
a = int(a)
amari=0

first = 9
third = 900
fifth = 90000
amari=0

if(l>1):
  if(l%2==1):
    amari = a%(10**(l-1)) + 1
    
  l-=1
  if(l==5):
    amari += (fifth + third + first)
  elif(l==3 or l==4):
    amari += (third + first)
  elif(l==1 or l==2):
    amari += (first)
  
elif(l==1):
  amari = a%10
  
print(amari)

Submission status: Wrong Answer

Solution code:
a = int(input())
unchi = -1
for i in range(1,a):
    if 99999 >= a >= 10000:
        unchi += 1
    elif 999 >= a >= 100:
        unchi += 1
    elif 9 >= a >= 1:
        unchi += 1
print(unchi)

Submission status: Wrong Answer

Solution code:
a = int(input())
unchi = 0
for i in range(1,a):
    if 99999 >= a >= 10000:
        unchi += 1
    elif 999 >= a >= 100:
        unchi += 1
    elif 9 >= a >= 1:
        unchi += 1
print(unchi)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(count)

Submission status: Wrong Answer

Solution code:
s = int(input())

if s < 100:
  print(s)
elif s < 1000:
  print(9+s)
elif s < 100000:
  print(908+s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

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

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

    print(len(result))
    return len(result)

Submission status: Wrong Answer

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

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

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

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

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

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

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

    print(len(result))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())

if a < 10:
  print(a)
elif a < 100:
  print(9)
elif a < 1000:
  print(a - 90)
elif a < 10000:
  print(910)
elif a < 100000:
  print(a - 90 - 9000)
elif a == 100000:
  print(90909)

Submission status: Wrong Answer

Solution code:
a = int(input())

if a < 10:
  print(a)
elif a < 100:
  print(9)
elif a < 1000:
  print(a - 90)
elif a < 10000:
  print(910)
elif a < 100000:
  print(a - 90 - 9000)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
all=0
a=5
while(a>0):
  if(10**a>N):
    a-=1
    continue
  if(a%2==1):
    all+=9*10**(a-1)
    a-=1
    continue
  else:
    all+=N+1-10**a
  a-=1
print(all)

Submission status: Wrong Answer

Solution code:
N=int(input())
all=0
a=5
while(a>0):
  if(10**a>N):
    a-=1
    continue
  if(a%2==1):
    all+=9*10**(a-1)
    a-=1
    continue
  else:
    all+=N+1-10**a
  
  a-=1

Submission status: Wrong Answer

Solution code:
N=int(input())
all=0
a=5
while(a>0):
  if(10**a>N):
    continue
  if(a%2==1):
    all+=9*10**(a-1)
    a-=1
    continue
  else:
    all+=N+1-10**a
  
  a-=1

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)
else:
	print(N-9000-90)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

n = int(input())

ans = solve(n)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = input()

result = 0

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

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

Submission status: Wrong Answer

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

# uneven numbers

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

Submission status: Wrong Answer

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

N = int(input())

odd = 0

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

print(odd)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(count)

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
  ans = n
elif n < 10**2:
  ans = 9
elif n < 10**3:
  h = n-99
  ans = h+9
elif n <= 10**5:
  t_t = n - 9999
  ans = t_t + 908
  
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = int(0)

if n < 10:
  ans = n
if 100 > n and n >= 10:
  ans = 9
if 1000 > n and n >= 100:
  ans = n-90
if 10000 > n and n >= 1000:
  ans = 909
if 100000 >= n and n >= 10000:
  ans = n-9091

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = int(0)

if n < 10:
  ans = n
if 100 > n and n > 10:
  ans = 9
if 1000 > n and n >= 100:
  ans = n-90
if 10000 > n and n >= 1000:
  ans = 909
if 100000 >= n and n >= 10000:
  ans = n-9091

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = int(0)

if n < 10:
  ans = n
elif 100 > n and n > 10:
  ans = 9
elif 1000 > n and n >= 100:
  ans = n-90
elif 10000 > n and n >= 1000:
  ans = 909
elif 100000 >= n and n >= 10000:
  ans = n-9091

Submission status: Wrong Answer

Solution code:
import sys

a = int(input())

cnt = 0

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())

array = np.arange(N)

n1=np.count_nonzero(array<10)
n2=np.count_nonzero((100<=array)&(array<1000))
n3=np.count_nonzero((10000<=array)&(array<100000))
ans=n1+n2+n3
print(ans)

Submission status: Wrong Answer

Solution code:
tmp = int(input())
#tmp = 136
input_num = tmp

lst = []
while tmp > 0:
    lst.append(tmp % 10)  # 余りが入るから右の桁から処理される。　例 345/10 % = 5
    tmp //= 10  # 必須
lst.reverse()


#print(lst)

#print(input_num)

ketasuu = len(lst)
ans = 0
flag = 0
tmp = 0

kazoeru = ketasuu - 1

#桁数が偶数のとき
if ketasuu % 2 == 0:
    for keta_num in reversed(range(kazoeru)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0

elif ketasuu == 1:
    ans = input_num

#桁数が奇数のとき
else:
    #print((10**ketasuu) * lst[0])
    ans = input_num - (10**kazoeru)
    ans = ans + 1

    for keta_num in reversed(range(kazoeru-1)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            print(tmp)
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0



print(ans)

Submission status: Wrong Answer

Solution code:
#tmp = int(input())
tmp = 136
input_num = tmp

lst = []
while tmp > 0:
    lst.append(tmp % 10)  # 余りが入るから右の桁から処理される。　例 345/10 % = 5
    tmp //= 10  # 必須
lst.reverse()


#print(lst)

#print(input_num)

ketasuu = len(lst)
ans = 0
flag = 0
tmp = 0

kazoeru = ketasuu - 1

#桁数が偶数のとき
if ketasuu % 2 == 0:
    for keta_num in reversed(range(kazoeru)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0

elif ketasuu == 1:
    ans = input_num

#桁数が奇数のとき
else:
    #print((10**ketasuu) * lst[0])
    ans = input_num - (10**kazoeru)
    ans = ans + 1

    for keta_num in reversed(range(kazoeru-1)):

        if flag == 0:
            tmp = (10**keta_num) * 9
            print(tmp)
            ans = ans + tmp
            #print("{} {}".format(ans,tmp))
            flag = 1
        else:
            flag = 0



print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())

cnt = 0

for i in range(1,10):
	cnt += 1
	if i < a :
		print (cnt)
		exit()

for j in range(100,1000):
	cnt += 1
	if i < a :
		print (cnt)
		exit()

for k in range(10000,100000):
	cnt += 1
	if i < a :
		print (cnt)
		exit()

Submission status: Wrong Answer

Solution code:
input = input().split(" ")
a = int(input[0])
def is_even(num):
    if num % 2 == 0:
        return "1"
    else:
        return "0"
numodds = 0
for num in range(a):
  length = len(str(num))
  tf = is_even(num)
  if tf == "0":
    numodds += 1
  else:
    pass
result = a - int(numodds)
print(numodds)

Submission status: Wrong Answer

Solution code:
import numpy as np
import getpass

N = input()

array = np.arange(int(N))

n1=np.count_nonzero(array<10)
n2=np.count_nonzero((100<=array)&(array<1000))
n3=np.count_nonzero((10000<=array)&(array<100000))
ans=n1+n2+n3
print(ans)

Submission status: Wrong Answer

Solution code:

N = input()

ans = 0

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

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

        dataS = N[i-1]

        if i == 1:
            ans = ans + 9

        elif i % 2 == 1:

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

                ans = ans + data1 + data2

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


print(str(ans))

Submission status: Wrong Answer

Solution code:
import numpy as np

N = input()

array = np.arange(int(N))

n1=np.count_nonzero(array<10)
n2=np.count_nonzero((100<=array)&(array<1000))
n3=np.count_nonzero((10000<=array)&(array<100000))
ans=n1+n2+n3
print(ans)

Submission status: Wrong Answer

Solution code:

N = input()

ans = 0

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

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

        dataS = N[i-1]

        if i == 1:
            ans = ans + 9

        elif i % 2 == 1:

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

                ans = ans + data1 + data2

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
if n < 10:
    digit = 1
else:
    digit = round(math.log10(n))+1

result = 0

t = 1
while True:
    if digit < t:
        break
    elif digit == t:
        # (digit-1)桁で表現できる数
        x = int('1' + '0'*(digit-1)) - 1
        result += (n - x)
        break
    else:
        result += 9 * int('1' + '0'*(t-1))
    t += 2
print(result)

Submission status: Wrong Answer

Solution code:
x=int(input())
if x>99999:
    a=90909
elif x>9999:
    a=x-9090
elif x>99:
    a=x-90
elif x>9:
    a=9
else:
    a=x
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 0
j = 0
while 1:
    j += 1
    if j == n:
        print(i)
        break
    else:
        if 9999 <= j < 10000000:
            i += 1 
        elif 99 <= j < 1000:
            i += 1 
        elif j < 10:
            i += 1

Submission status: Wrong Answer

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

N = int(input())

num = len(str(N))

if num == 1:
    print(N)
    exit(0)

odd = 0
for x in range(1, num):
    if x % 2 == 1:
        odd += (10 ** x)
        if x != 1:
            odd -= 10 ** (x-1)

if num % 2 == 1:
    odd += N % (10**(num-1)) + 1

odd -= 1

print(odd)