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

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:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int):
    counter = 0
    for i in range(len(str(N))-1, 0, -1):
        if i % 2 == 0:
            continue
        counter += 9*(10**(i-1))
    if len(str(N)) % 2 == 1:
        counter += N-10**(len(str(N))-1)+1
    print(counter)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

# S = input()
N = input()
# v = map(int, input().split())

n = int(N)

keta = len(N)

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

Submission status: Accepted

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

def readInts():
  return [int(s) for s in input().split(" ")]

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

if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
n=input()
m=len(n)
if m%2==0:
    ans=0
    for i in range(m//2):
        ans+=9*(10**(2*i))
    print(ans)
else:
    ans=0
    for i in range(m//2):
        ans+=9*(10**(2*i))
    ans+=int(n)-10**(m-1)+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 !=0:
    ans +=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    cnt = 0
    for i in range(1, N + 1):
        s = str(i)
        if(len(s) % 2 == 1):
            cnt += 1
    print cnt

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC136b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(1, N+1):
    str_i = str(i)
    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):
  a = [_ for _ in str(i)]
  if len(a)%2==1:
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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
    elif 100 <= i and i <= 999:
        cnt += 1
    elif 10000 <= i and i <= 99999:
        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:
import sys
input = sys.stdin.readline
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:
#!/usr/bin/env python3
import sys


def solve(N: int):
    count = 0
    for x in range(1, N+1):
        x_str = str(x)
        if len(x_str) % 2 != 0:
            count += 1
    print(count)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    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:
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())
ans=0
for i in range(n):
    if i+1<10 or (i+1<1000 and 99 <i+1) or (i+1<100000 and 9999 <i+1):
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

count = 0
for i in range(1, n+1):
    k = 0
    while True:
        k += 1
        i = i // 10
        if i == 0:
            break
    if k % 2 == 1:
        count+=1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
ans=0
for i in range(1,7):
    if i % 2 == 1:
        ans += max(min(n, 10**i-1) - (10**(i-1)-1), 0)

print(ans)

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

N = int(input())
li = []
ctr = 0

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

Submission status: Accepted

Solution code:
N = int(input())
def num_digits(n):
    ans = 0
    while n:
        ans += 1
        n //= 10
    return ans


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

Submission status: Accepted

Solution code:
import sys

def f(x):
  ret=0
  while x:
    ret+=1
    x//=10
  return ret

n=int(input())
ans=0
for i in range(n):
  x=i+1
  if f(x)%2==1:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
#A, B = list(map(int,input().split()))
#A = [int(input()) for _ in range(N)]
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())
cnt = 0
for i in range(1,N+1):
    str_i = str(i)
    if len(str_i)%2:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

temp = 0

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

print(temp)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

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

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

Submission status: Accepted

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


def solve(N: int):
    count = 0
    for i in range(1,N+1):
        if len(str(i)) in [1,3,5]:
            count += 1
    print(count)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right; from collections import Counter, defaultdict, deque, OrderedDict; from copy import deepcopy; from fractions import gcd; from functools import lru_cache, reduce; from math import ceil, floor; from sys import stdin, setrecursionlimit
import heapq as hq; import itertools as its; import operator as op


# globals
inf = float('inf')
input = stdin.readline


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


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def gets(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input().strip()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().strip().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    setrecursionlimit(4100000)
    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())

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

print(cnt)

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

ans = 0
for i in range(1,N+1) :
    if 1 <= 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())
num = list(range(1,n+1))
count = 0
for i in num:
    if i < 10 or (i >= 100 and i < 1000) or (i >= 10000 and i < 100000):
        count += 1
print(count)

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(1, N+1):
    s = str(i)
    l = len(s)

    if l % 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:
N = int(input())

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys

sys.setrecursionlimit(100000)

MIN = -10 ** 9
MAX = 10 ** 9 + 7


def main():
    N = int(input())
    c = 0
    for i in range(1, N + 1):
        if len(str(i)) % 2 == 1:
            c += 1
    print(c)
    # a, b, c = [int(a) for a in input().split()]
    # # A = [
    # #     int(input())
    # #     for _ in range(N)
    # # ]
    # A = [int(a) for a in input().split()]



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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:
#!/usr/bin/env python
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:
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

N = int(stdin.readline().rstrip())

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

if N < 10:
  print(N)
elif N < 100:
  print(9)
elif N < 1000:
  print(N - 90)
elif N < 10000:
  print(909)
elif N < 100000:
  print(N - 9090)
else:
  print(90909)

Submission status: Accepted

Solution code:
# 愚直にやってもどうせ間に合う


n = int(input())


def keta(x):
    k = 0
    while x > 0:
        x //= 10
        k += 1
    return k


ans = 0
for i in range(n, 0, -1):
    if keta(i) % 2 == 1:
        ans += 1


print(ans)

Submission status: Accepted

Solution code:
import sys
MAX_INT = int(10e9)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()

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

print(cnt)

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-99+9)
elif len(n) == 5:
  print(int(n) - 9999 + 999 -99 + 9)
else:
  print(99999-9999+999-99+9)

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 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(list(str(i)))%2==1:
        count+=1
print(count)

Submission status: Accepted

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

print(ans - 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

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())
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
n = int(input())
ans = 0
for x in range(1,n+1):
    if((1+math.floor(math.log10(x)))%2 == 1):
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))

#################

N = I()

dig = len(str(N))
if dig==1:
  print(N)
  exit()
if dig==2:
  print(9)
  exit()
if dig==3:
  print(9+N-100+1)
  exit()
if dig==4:
  print(9+900)
  exit()
if dig==5:
  print(9+900+N-10000+1)
  exit()
if dig==6:
  print(9+900+90000)

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N=INT()

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

Submission status: Accepted

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

sum_c = 0

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

print(sum_c)

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, os
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-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 _pf(s): return print(s, flush=True)
def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('- {} -> {}'.format(name, val), file=sys.stderr)
            return None

def main(N):
    """
    10*5みる
    """
    ans = 0
    for i in range(0, N):
        num = N - i
        #  print(num)
        if len(str(num)) % 2 == 1:
            ans += 1
    return ans


if __name__ == '__main__':
    if 'LOCAL' in os.environ:
        # ローカル実行時のみ通る処理
        # テストしたい入力を入れておく
        input_values = [
                """
                """.strip(),
                """
                """.strip()
                ]
        for input_value in input_values:
            input_value = input_value.split('\n')
            #  N = int(input_value[0])
            #  A = list(map(int, input_value[1].split()))
            ans = main(N, A)
            expected_value = int(input_value[2])
            assert ans == expected_value, 'failed: ans: {ans}, exp: {exp}'.format(ans=ans, exp=expected_value)
    else:
        N = _I()

        print(main(N))

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    count = 0
    for i in range(1, N+1):
        if len(str(i)) % 2 == 1:
            count += 1
    return count




def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

ans = 0
N = int(input())
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())
r = 0
for i in range(1, 10):
  if i <= N:
    r += 1
for i in range(100, 1000):
  if i <= N:
    r += 1
for i in range(10000, 100000):
  if i <= N:
    r += 1
print(r)

Submission status: Accepted

Solution code:
from collections import Counter
from collections import deque
from functools import reduce
from operator import mul
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) 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 MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))
def COMBINATION(n, r):
    if n < 0 or r < 0 or n < r:
        return 0
    r = min(n-r, r)
    if r == 0:
        return 1
    o = reduce(mul, range(n, n - r, -1))
    u = reduce(mul, range(1, r + 1))
    return o // u
class UnionFind():

    def __init__(self, n):
        self.n = n
        self.node = [i for i in range(n)]
        self.size = [1 for _ in range(n)]

    def same(self, x, y):
        return bool(self.root(x) == self.root(y))

    def root(self, x):
        if self.node[x] == x:
            return x
        else:
            self.node[x] = self.root(self.node[x])  # 経路圧縮
            return self.node[x]

    def unite(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y:
            return  # 結合不要
        if self.size[x] < self.size[y]:
            x, y = y, x
        self.node[y] = x
        self.size[x] += self.size[y]

    def return_size(self, x):
        return self.size[self.root(x)]


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    
    def f(a):
        if a < 10:
            return 1
        elif a < 100:
            return 0
        elif a < 1000:
            return 1
        elif a < 10000:
            return 0
        elif a < 100000:
            return 1
        else:
            return 0
        
        
    
    a = int(input())
    
    print(sum([f(i) for i in range(1, a + 1)]))
    
    return 0

main()

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
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())
ans=0
for i in range(n):
  hoge=str(i+1)
  if(len(hoge)%2==1):
    ans+=1
print(ans)

Submission status: Accepted

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


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

    for i in range(1, n + 1):
        if 10 <= i <= 99:
            continue
        elif 1000 <= i <= 9999:
            continue
        elif i == 100000:
            continue
        else:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
n = n[0]
count = 0
for i in range(n):
    ii = i+1
    if(len(str(ii))%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 = input()
l = len(N)
N = int(N)
if l == 1:
    print(N)
elif l == 2:
    print(9)
elif l == 3:
    print(9 + (N - 99))
elif l == 4:
    print(9 + 900)
elif l == 5:
    print(9 + 900 + (N - 9999))
else:
    print(9 + 900 + 90000)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
for i in range(1,N+1):
    if len(str(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 = int(input())

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

print(c)

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

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

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:
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:
def debug(*args):
    if 1 == 0:
        print(*args)

def solve(N, A):
    pass

def main():
    N = int(input())
    print(sum(len(str(s)) % 2 for s in range(1, N+1)))

main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


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


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

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(list(s)) % 2 == 1:
        cnt += 1

print(cnt)

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)