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:
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
# input = sys.stdin.readline
from math import factorial

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






if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 136, 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:
import sys
import math
input = sys.stdin.readline

N = int(input())
ans = 0

for i in range(1, N+1):
    dig = int(math.log10(i))
    if (dig+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())
cnt = 0
for i in range(1, N + 1) :
    if(len(str(i)) % 2 == 1) :
        cnt += 1
    else :
        pass
print(cnt)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
	n = int(input().strip())
	c = 0
	for i in range(1, n+1):
		if len(str(i)) % 2 == 1:
			c += 1
	print(c)
if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

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


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
ans = 0
for i in range(1, n+1):
    temp = i
    cnt = 0
    while temp > 0:
        temp //= 10
        cnt += 1

    if cnt % 2:
        ans += 1

print(ans)

Submission status: Accepted

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

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 f(x):
    res = 0
    while x > 0:
        x //= 10
        res += 1
    return res


n = int(input())

ans = 0
for i in range(1, n + 1):
    if f(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 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())
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())
num = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 != 0:
        num += 1

print(num)

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = 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())
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())
print(sum(1 for i in range(1, n+1) if len(str(i))%2 == 1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
def solve():
    n = read()
    result = think(n)
    write(result)


def read():
    return read_int(1)[0]


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


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


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]

# 
# a, b = map(int, input().split())
# s = input()

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


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


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N):
    ans = 0
    for i in range(1, N+1):
        if len(str(i)) % 2 == 1:
            ans += 1
    return ans


def main():
    N = read_int()
    print(slv(N))


if __name__ == '__main__':
    main()

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:
a = int(input())
c = 0
for i in range(1, a + 1):
    b = str(i)
    c += 1 if len(b) % 2 == 1 else 0
print(c)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
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 I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()

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

  return c

# main()
print(main())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1, n+1):
    s = str(i)
    if len(s) % 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:
import math
import copy
from operator import mul
from functools import reduce
from collections import defaultdict
from collections import Counter
from collections import deque
# 直積 A={a, b, c}, B={d, e}:のとき，A×B={(a,d),(a,e),(b,d),(b,e),(c,d),(c,e)}: product(A, B)
from itertools import product
# 階乗 P!: permutations(seq), 順列 {}_len(seq) P_n: permutations(seq, n)
from itertools import permutations
# 組み合わせ {}_len(seq) C_n: combinations(seq, n)
from itertools import combinations
# 一次元累積和
from itertools import accumulate
from bisect import bisect_left, bisect_right

import re
# import numpy as np
# from scipy.misc import comb

# 再帰がやばいとき
# import sys
# sys.setrecursionlimit(10**9)

def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W

# 四方向: 右, 下, 左, 上
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
 
def i_inpl(): return int(input())
def l_inpl(): return list(map(int, input().split()))
def line_inpl(x): return [i_inpl() for _ in range(x)]

INF = int(1e50)
MOD = int(1e9)+7 # 10^9 + 7

# field[H][W]
def create_grid(H, W, value = 0):
    return [[ value for _ in range(W)] for _ in range(H)]

########

def main():
    # A, B, C =l_inpl()
    # print(max(C-(A-B), 0))
    N = i_inpl()
    ans = 0
    for i in range(1, N+1):
        if len(str(i)) % 2 == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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


def solve(N: int):
    res = 0
    for i in range(1, N+1):
        if len(str(i)) % 2 == 1:
            res += 1
    print(res)
    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:
ans = [0]*10**5
n = 0
for i in range(10**5):
    if len(str(i+1))%2 == 1:
        n += 1
    ans[i] = n
N = int(input())
print(ans[N-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())
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 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):
    tmp = str(i)
    if len(tmp) % 2 ==1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-



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

Submission status: Accepted

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

Submission status: Accepted

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

    print(ans)

main()

Submission status: Accepted

Solution code:
def inpl():
    return list(map(int, input().split()))


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

print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

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

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7

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

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 = 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:
#!/usr/bin/env python3
import sys


def solve(N: int):

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

    print(res)



# 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:
n = int(input())

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

print(cnt)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
from functools import reduce
import sys
import math
import bisect
import random
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return list(map(float, sys.stdin.readline().split()))
def LS():return sys.stdin.readline().split()
def SR(n): return [list(sys.stdin.readline())[:-1] for i in range(n)]
def IR(n): return [int(sys.stdin.readline()) for i in range(n)]
def LIR(n): return [list(map(int, sys.stdin.readline().split())) for i in range(n)]
def LSR(n): return [list(map(list, sys.stdin.readline().split())) for i in range(n)]
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

N = I()
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())

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 int(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):
    if len(str(i)) % 2 == 0:
        pass
    else:
        ans += 1

print(ans)

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:
N = int(input())
c = 0
for i in range(1,N+1):
    c += len(str(i))%2

print(c)

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# @author 

import sys

class BUnevenNumbers:
    def solve(self):
        n = int(input())
        ans = 0
        for i in range(1, n + 1):
            if len(str(i)) % 2 == 1:
                ans += 1
        
        print(ans)
                

solver = BUnevenNumbers()
input = sys.stdin.readline

solver.solve()

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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 os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

# A, B, C = list(map(int, sys.stdin.readline().split()))
# ans = max(0, C - (A - B))
#
# print(ans)

N = int(sys.stdin.readline())
ans = 0
for i in range(1, N + 1):
    ans += len(str(i)) & 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())
print(len([1 for i in range(1, n+1) if len(str(i)) % 2 == 1]))

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    ans = 0
    for i in range(1,N+1):
        if len(str(i))%2 == 1:
            ans += 1
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
def input(): return sys.stdin.readline().strip()
def gcd(x, y): return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y): return (x * y) // gcd(x, y)
MOD = 10 **9 + 7

N = int(input())
# S = input()
# N, M = map(int, input().split())
# 横
# L = [int(x) for x in input().split()]
# 縦
# A = [int(input()) for _ in range(N)]
# 多次元
# L = [[int(x) for x in input().split()] for _ in range(N)]

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

Submission status: Accepted

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


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

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
res = sum(1 for i in range(n) if len(str(i + 1)) & 1)
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import itertools
import math
from collections import defaultdict

def input_ints():
    return list(map(int, input().split()))

def solve():
    n = int(input())
    ans = 0
    for x in range(1, n + 1):
        if len(str(x)) % 2 == 1:
            ans += 1
    print(ans)


if __name__ == '__main__':
    solve()

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

Submission status: Accepted

Solution code:
N = int(input())

ans = sum(len(str(i)) % 2 == 1 for i in range(1, N + 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:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res

def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    a,b,c = LI()
    c -= a-b
    print(max(0,c))
    return

#B
def B():
    n = I()
    ans = 0
    for i in range(1,n+1):
        s = str(i)
        if len(s)%2:
            ans += 1
    print(ans)
    return

#C
def C():

    return

#D
def D():

    return

#E
def E():

    return

#F
def F():

    return

#Solve
if __name__ == "__main__":
    B()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)


def solve(N: int):
    def dig(n):
        ret = 0
        while n > 0:
            ret += 1
            n //= 10
        return ret
    ret = 0
    for i in range(1, N + 1):
        if dig(i) % 2 == 1:
            ret += 1
    print(ret)
    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:
# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意

n = int(input())
#n,d = [int(i) for i in readline().split()]


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

print(ans)

Submission status: Accepted

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

from collections import deque
import itertools as ite
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()

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

Submission status: Runtime Error

Solution code:
a, b, c = map(int,input().split())
print(max(0,c-(a-b))

Submission status: Runtime Error

Solution code:
X=input()
s=input()
s=s.replace(X,"")
print(s)

Submission status: Runtime Error

Solution code:
n=int(input())
if len(n)==1:
    print(n)
elif len(n)==2:
    print(9)
elif len(n)==3:
    print(n-90)
elif len(n)==4:
    print('909')
elif len(n)==5:
    print(n-9090)
else:
    print('90909')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())


count=len(str(n))
ans=''
if count%2==0:
    for i in range(count-1):
        if i%2==0:
            ans+='9'
        else:
            ans+='0'
else:
    ans=count//2*'90'
    ans=n-int(ans)
print(int(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(cnt)

Submission status: Runtime Error

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: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())

sum=0
if len(str(N))%2==0:
    for i in range(int(len(str(N))/2)):
        sum += 9*10**(i*2)
else:
    for i in range(len(str(N))//2):
        sum += 9*10**i
    sum += N-int("9"*(len(str(N))-1))

print(sum)

Submission status: Runtime Error

Solution code:
n = int(input())
lis = list(map(int,input().split()))
for i in range(n-1):
  if lis[i] -1 >= lis[i+1]:
    lis[i] -= 1
for i in range(n-1):
  if lis[i] > lis[i+1]:
    print("No")
    exit()
print("Yes")