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: Accepted

Solution code:
def actual(n):
    return len([i for i in range(1, n + 1) if len(str(i)) % 2 == 1])

    # nums = [i for i in range(1, n+1)]
    # return len([n for n in nums if len(str(n)) % 2 == 1])

n = int(input())
print(actual(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
a = len(n)  # 桁数
if a % 2 == 0:  # 桁数が偶数
  ans = "90" * (a // 2)
  ans = int(ans[:-1])
else:
  if a == 1:
    ans = int(n)
  else:
    ans = "90" * ((a - 1) // 2)
    ans = int(ans[:-1])
    ans += int(n) - 10 ** (a - 1) + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
count=0
for i in range(1,N+1):
	s = str(i)

	ll=len(s)
	if ll%2==1:
		count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#整数 Nが与えられます。N以下の正の整数のうち、(先頭に 0をつけずに十進法で表記したときの) 桁数が奇数であるようなものの個数を求めてください。

n=str(input())
m=len(n)
n=int(n)
#m桁の場合
if m%2==1:
  cnt=n-10**(m-1)+1
else:
  cnt=0

#１桁からm-1桁までの場合
for i in range(0, m):
  if i%2==1:
    cnt+=10**i-10**(i-1)
print(cnt)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    n = int(input())

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

    print(ans)


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
import sys

def main():
    N = int(input())
    
    cnt = 0
    for i in range(1, N+1):
        if 1 <= i < 10:
            cnt += 1
        elif 100 <= i < 1000:
            cnt += 1
        elif 10000 <= i < 100000:
            cnt += 1
                    
    print(cnt)
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for i in range(1,n+1):
  if i // 10 == 0 or 10 <= i//10 < 100 or 1000 <= i//10 < 10000:
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
N  = int(input())
def divisor(n):
    div_list = []
    for i in range(1, int(1+ n**0.5)):
        if n%i == 0 and i**2 == n:
            div_list.append(i)
        elif n%i == 0:
            div_list.append(i)
            div_list.append(int(n/i))
    return div_list
counter = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
num = 0
for i in range(6):
  if N >= 10**i and N < 10**(i+1):
    keta = i+1
if keta == 1:
  num = N
elif keta == 2:
  num = 9
elif keta == 3:
  num = 9 + N - 99
elif keta == 4:
  num = 909
elif keta == 5:
  num = 909 + N -9999
else:
  num = 90909
print(num)

Submission status: Accepted

Solution code:
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(909 + n - 10000 + 1)
else:
    print(9 + 900 + 90000)

Submission status: Accepted

Solution code:
def f(N):
    x=0
    for i in range(N+1):
        t=str(i)
        if len(t)%2==1:
            x+=1
    return x-1
N=int(input())
print(f(N))

Submission status: Accepted

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

print(b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

n = int(input())

ans = 0
for i in range((len(str(n))+1)//2):
    num = 10**(2*i)
    line = num*10-1
    # print(num)
    # print(line)
    # print()

    if n-line >= 0:
        ans += num*9
    else:
        ans += n-num+1

print(ans)
# n-num
# 9, 900
# if
# 1, 100, 10000

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
k = len(str(n))
ans = 0
if k % 2 == 0:
    for i in range(k//2):
        ans += 10**((i*2)+1) - 10**(i*2)
else:
    for i in range(k//2):
        ans += 10**((i*2)+1) - 10**(i*2)
    ans += n - 10**(k-1) + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())
cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

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

Submission status: Accepted

Solution code:
n = input()

intn = int(n)

if len(n) == 1:
    print(intn)
elif len(n) == 2:
    print("9")
elif len(n) == 3:
    print(intn - 100 + 1 + 9)
elif len(n) == 4:
    print(900+9)
elif len(n) == 5:
    print(intn - 10000+ 1 + 900 +9)
else:
    print("90909")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = int(input())

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

Submission status: Accepted

Solution code:
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N = int(input())

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math


def main():
    N = int(input())
    digit = math.floor(math.log10(N)) + 1
    if digit == 1:
        print(N)
    elif digit == 2:
        print(9)
    elif digit == 3:
        print(9 + N - 100 + 1)
    elif digit == 4:
        print(909)
    elif digit == 5:
        print(909 + N - 10000 + 1)
    elif digit == 6:
        print(90909)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

count= 0

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

print(count)

Submission status: Accepted

Solution code:
a = int(input())
total = 0

    
for i in range(1,a+1):
    if i<10 or 99<i<1000 or 9999<i<100000:
        total+=1

print(total)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
i = 1
cnt = 0
while i <= n:
    if len(str(i)) % 2 >= 1:
        cnt += 1
    i += 1
print(cnt)

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

Solution code:
def ketaodd(n):
    if len(str(n)) % 2 != 0:
        return True
    else:
        return False
m = int(input())
ans = 0
for i in range(1,m+1):
    ans += ketaodd(i)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def odd(x):
    if (x-1)%2 == 0:
        return True
    else:
        return False


N = input()
index, num = len(N), int(N)

ans = 0
for i in range(1, index+1):
    if odd(i):
        if num >= 10**i:
            ans = ans + (10**i - 10**(i-1))
            
        else:
            ans = ans + (num - 10**(i-1) + 1)
            
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if n >= 10000:
    ans += n - 9999
    ans += 909
    if n == 100000:
        ans -= 1
    print(ans)
    exit()

if n >= 100:
    ans += n - 99
    ans += 9
    if n >= 1000:
        ans -= n-999
    print(ans)
    exit()

if n > 9:
    print(9)
    exit()

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=list(input())
ans=0
for i in range(len(N)):
    if i==len(N)-1:
        if len(N)%2==1:
            s=""
            for num in N:
                s=s+num
            s=int(s)-10**i
            s+=1
            ans+=s
    else:
        if i%2==0:
            ans+=10**(i+1)-10**i
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
cnt =0
for i in range(1,N+1):
    if 1 <= i and i <= 9:
        cnt += 1
    
    if 100 <= i and i <= 999:
        cnt += 1

    if 10000 <= i and i <= 99999:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
N = input()
if len(N)==1:
    print(int(N))
elif len(N)==2:
    print(9)
elif len(N)==3:
    print(int(N)-99 + 9)
elif len(N)==4:
    print(999-100+1+9)
elif len(N)==5:
    print(int(N)-9999 + 999-100+1+9)
elif len(N)==6:
    print(90909)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def uneven_numbers(n):

    ans = 0

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

    return ans

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n = I()
    cnt = 0
    for i in range(1, n+1):
        if len(str(i)) %2 == 1:
            cnt += 1
    print(cnt)

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

for i in range(N):
    if N <= 9:
        print(N)
        break
    elif N <= 99:
        print("9")
        break
    elif N <= 999:
        print(N-99+9)
        break
    elif N <= 9999:
        print("909")
        break
    elif N <= 99999:
        print(N-9999+909)
        break
    else:
        print("90909")
        break

Submission status: Accepted

Solution code:
N = int(input())

print(len([0 for n in range(1, N + 1) if len(str(n)) % 2 == 1]))

Submission status: Accepted

Solution code:
import math

N = int(input())

digits = int(math.log10(N)) + 1

s = 0
for d in range(1, digits, 2):
    s += 9 * int(math.pow(10, d - 1))

if digits % 2 == 1:
    s += N - int(math.pow(10, digits - 1)) + 1

print(s)

Submission status: Accepted

Solution code:
N = int(input())

if 1<=N<=9:
    print(N)
    exit()

if 10<=N<=99:
    print(9)
    exit()

if 100<=N<=999:
    print(9+N-99)

if 1000<=N<=9999:
    print(909)
    exit()

if 10000<=N<=99999:
    print(909+N-9999)
    exit()

if N ==100000:
    print(90909)
    exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
import math
import copy
from queue import Queue
import heapq
import numpy as np

MOD = 5000000007

n = int(input())
#b = int(input())
#n, m = [int(i) for i in input().split()]
#table = [[int(i)  for i in input().split()] for j in range(m)]
#table = [list(input()) for n in range(r)] #table[h][w]
#p = [int(i) for i in input().split()]
#s = [int(i) for i in range(n)]
#p = [int(input()) for i in range(m)]
#s = input()

#list = list(s)
#dp = [MOD for _ in range(m)]
#dp = [[0 for _ in range(n+1)] for _ in range(n+1)]
#dp = [[[0 for _ in range(11)] for _ in range(2)] for _ in range(11)]

#Combination = [[0 for _ in range(n+1)] for _ in range(n+1)]
#b = [[0 for _ in range(n+1)] for _ in range(n+1)]

sum = 0
for i in range(1,n+1):
    if((1 <= i and i < 10) or (100 <= i and i < 1000) or (10000 <= i and i < 100000)):
        sum += 1

print(sum)

Submission status: Accepted

Solution code:
n = int(input())
lis = []

for a in range(1, n+1):
  if len(str(a)) % 2 == 1:
    lis.append(a)
    
print(len(lis))

Submission status: Accepted

Solution code:
N=int(input())
ans=0
i=1
while i<=N:
    if not len(str(i))%2==0:
        ans+=1
    i+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(1, n+1):
  keta = 0
  # print('target: ', i)
  while i > 0:
    i = i // 10
    keta += 1
  # print('keta: ', keta)
  if keta % 2 != 0:
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import *

n = int(stdin.readline())
ans = 0
for i in range(1, n + 1):
	s = str(i)
	if len(s) % 2 is 1:
		ans += 1 
print(ans)

Submission status: Accepted

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

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

for i in range(1, s):
  if(i % 2 == 1):
    count += (10 ** (i - 1)) * 9
print(count)

Submission status: Accepted

Solution code:
s=input()
n=int(s)
s=list(s)
d=len(s)
r=0
for ii in range(d-1):
  if ii%2==0:
    r+=10**(ii+1)-10**ii
if d%2==1:
  r+=n-10**(d-1)+1
print(r)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
a=0
b=0
for i in range(1,7):
  if 10**(i-1)<=n<10**i:
    a=i
if a==2:
  print(9)
if a==4:
  print(909)
if a==6:
  print(90909)
if a==1:
  print(n)
if a==3:
  print(n-90)
if a==5:
  print(n-9090)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri May 15 00:31:41 2020

@author: Kanaru Sato
"""

n = int(input())

count = 0
for i in range(1,n+1):
    if 1<=i and i<=9:
        count += 1
    elif 100 <= i and i <= 999:
        count += 1
    elif 10000 <= i and i <= 99999:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n=input()

k=len(n)
if k==6:
    print(9+900+90000)
elif k==5:
    print(9+900+int(n)-10000+1)
elif k==4:
    print(9+900)
elif k==3:
    print(9+int(n)-100+1)
elif k==2:
    print(9)
else:
    print(int(n))

Submission status: Accepted

Solution code:
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(909)
elif 10000<=n and n<=99999:
    print(909+n-10000+1)
else :
    print(90909)

Submission status: Accepted

Solution code:
n = int(input())

def countKeta (num):
    return len(str(num))

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = [len(str(i+1))%2==1 for i in range(n)]
print(sum(x))