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

keta = len(str(N))

if keta % 2 == 0:
     ans = 0
else:
     ans = N - 10 ** (keta-1) + 1

i = 1
while i < keta:
     ans += 10**i - 10**(i-1)
     i += 2


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if n <= 99:
    print(min(n, 9))
elif 100 <= n <= 9999:
    print(9 + ((min(n, 999)) - 99))
else:
    print(9 + 900 + min(n, 99999) - 9999)

Submission status: Accepted

Solution code:
n = int(input())

keta = len(str(n))
cnt = 0

for i in range(keta):
    if i%2 != 0: #odd
        cnt += 10**i - 10**(i-1)
    if i == keta-1 and keta%2 != 0:
        cnt += n - 10**(keta-1) + 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 != 0:
        count+=1
        
print(count)

Submission status: Accepted

Solution code:
def main():

    number = int(input())
    count = 0

    for i in range(1, number+1):

        length = len(str(i))
        if length%2 != 0:
            count += 1


    print(count)


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 !=0:
    ans+=1
    
print(ans)

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

while num >= 1:
    num = num / 10
    count += 1

if count % 2 == 0:
    count -= 1
    while count > 0:
        result += 10**(count)-10**(count-1)
        count -= 2
else:
    result = result + N - 10**(count-1) + 1
    count -= 2
    while count > 0:
        result += 10**(count)-10**(count-1)
        count -= 2

print(result)

Submission status: Accepted

Solution code:
N=input()

count=0
for i in range(1,int(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):
    if len(str(i)) % 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:
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:
import math
N = int(input())
digit = int(math.log10(N)) + 1
ans = 0
for i in range(1, digit, 2):
  ans += 9 * (10 ** (i-1))
 
if digit % 2 == 1:
  ans += N - (10 ** (digit - 1) - 1)
 
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

step = sum([90*100**i for i in range(len(str(N))//2)])
dance_floor = sum([9*100**i for i in range(len(str(N))//2)])

ans = len(str(N))%2 * (N-step)  +  -1*(len(str(N))%2-1) * dance_floor
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if 1 <= n <= 9:
    print(n)
elif 10 <= n <= 99:
    print(9)
elif 100 <= n <= 999:
    print(9 + (n - 99))
elif 1000 <= n <= 9999:
    print(9 + 900)
elif 10000 <= n <= 99999:
    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):
    if len(str(i)) % 2 == 1:
        count += 1
print(count)

Submission status: Accepted

Solution code:
n=input()
len_n=len(n)
i=1
ans=0
while(i<len_n):
    if i%2!=0:
        ans+=9*10**(i-1)
    i+=1
if len_n%2!=0:
    ans+=(int(n)-10**(len_n-1)+1)
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    N = int(input())
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    cnt=0
    for i in range(1,N+1):
        if len(str(i))%2==1:
            cnt+=1
    print(cnt)




if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))

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

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 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = input()
l = len(N)
ans = 0

if l == 1:
    ans = int(N)
elif l == 2:
    ans = 9
elif l == 3:
    ans =  int(N) + 9 - 99
elif l == 4:
    ans = 909
elif l == 5:
    ans = int(N)+ 909 - 9999
else:
    ans = 90909
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
size = len(n)
n = int(n)
i = 1
ans = 0
while 2*i-1 < size:
  ans = ans + 9*(10**(2*i-2))
  i = i+1
if size%2==1:
  ans = ans + (n-10**(size-1)) + 1
  
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
ans=0
l=len(str(N))
for i in range(l+1):
    if i!=l and i%2!=0:
        ans+=(10**i)-(10**(i-1))
    if i==l and i%2!=0:
        ans+=(N-(10**(i-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!=0:
        ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(counter)

Submission status: Accepted

Solution code:
n = int(input())
ret = 0
for i in range(1, n+1):
    if i < 10:
        ret += 1
    elif 10**2 <= i < 10**3:
        ret += 1
    elif 10**4 <= i < 10**5:
        ret += 1
print(ret)

Submission status: Accepted

Solution code:
n = int(input())
res = 0
for i in range(6):
    if n // (10 ** i) >= 10 and (i + 1) % 2 == 1:
        res += 9 * (10 ** i)
    elif 1 <= n // (10 ** i) < 10 and (i + 1) % 2 == 1:
        res += ((n // (10 ** i)) - 1) * (10 ** i)
        res += (n % (10 ** i)) + 1 # i になってなかった
print(res)

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

# print(res_2)

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

print(counter)

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

Submission status: Accepted

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

Submission status: Accepted

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

    print(cnt)

if __name__ == '__main__':
    abc136_b()

Submission status: Accepted

Solution code:
N=int(input())
arr=[]

a=N
while a>0:
    arr.append(a%10)
    a=a//10

keta=len(arr)

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

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:
import sys
readline = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
n = int(input())
print(len(list(filter(lambda x : len(str(x)) % 2 & 1, range(1, n+1)))))

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

Submission status: Accepted

Solution code:
N = int(input())
res = 0
for i in range(N):
  if  (i+1) // 100000 >= 1:
    pass
  elif (i+1) // 10000 >= 1:
    res +=1
  elif (i+1) // 1000 >= 1:
    pass
  elif (i+1) // 100 >= 1:
    res += 1
  elif (i+1) // 10 >= 1:
    pass
  else:
    res += 1
print(res)

Submission status: Accepted

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

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:
import sys
N = int(input())
Nlen = len(str(N))
ans = 0
if Nlen == 1:
    ans = N
elif Nlen == 2:
    ans = 9
elif Nlen == 3:
    ans = 9+N-99
elif Nlen == 4:
    ans = 9+900
elif Nlen == 5:
    ans = 9+900+N-9999
elif Nlen == 6:
    ans = 9+900+90000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
print(sum(len(str(i + 1)) % 2 for i in range(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:
n = int(input())
count = 0
for i in range(1,n+1):
  if 1<=i<=9 or 100<=i<=999 or 10000<=i<=99999:
    count += 1
print(count)

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())
count = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if len(n) <= 1:
    print(n)
if 2 <= len(n) <3:
    print(9)
if 3<= len(n) <4:
    print(s-99 + 9)
if 4 <= len(n) < 5:
    print(999-99+9)
if 5 <= len(n) < 6:
    print(s -9999 + 999 - 99 + 9)
if len(n) == 6:
    print(99999-9999 + 999 -99 +9)

Submission status: Accepted

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

Submission status: Accepted

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

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())
count=0
for i in range(1,N+1):
  if 1 <= i <= 9:
    count+=1
  elif 100 <= i <= 999:
    count+=1
  elif 10000 <= i <= 99999:
    count+=1
print(count)

Submission status: Accepted

Solution code:
import sys
import math

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


def main():
    N = int(input())
    count =0
    for i in range(1,N+1):
        if int(math.log10(i)) %2 ==0:
            count +=1
    print(count)



if __name__ == "__main__":
    main()

Submission status: Accepted

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

if not ( 1 <= N <= 10**5 ): sys.exit()

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())
keta = len(str(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)
else:
    print(90909)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(x)

Submission status: Accepted

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
	n = int(input())

	cnt = 0
	for x in range(1,n+1):
		s = str(x)
		if len(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)

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 = 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)) == 1 or len(str(i)) == 3 or len(str(i)) == 5:
    ans +=1
print(ans)

Submission status: Accepted

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

if len(str(N)) % 2 != 0:
    sub = 10 ** (len(str(N))) - N - 1

    for i in range(len(str(N)), 0, -2):
        ans += 10 ** i - 10 ** (i-1)
    ans -= sub
    print(ans)
else:
    digits = len(str(N)) - 1
    for i in range(digits, 0, -2):
        ans += 10 ** i - 10 ** (i-1)
    print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
print(sum([int(math.log10(x)) % 2 == 0 for x in range(1, N + 1)]))

Submission status: Accepted

Solution code:
# coding: utf-8

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

Submission status: Accepted

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

if n <= 99:
    print(min(9, n))
elif n <= 9999:
    print(9 + min(900, n - 99))
elif n <= 999999:
    print(9 + 900 + min(90000, n - 9999))

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    N = ii()

    ret = 0
    for n in range(1, N + 1):
        if len(str(n)) % 2 != 0 and len(str(n)) <= len(str(N)):
            ret += 1
    print(ret)


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def cnt_keta(n):
  keta = 0
  while n > 0:
    n //= 10
    keta += 1
  return keta

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = int(input())
ans = 0
for i in range(1, n+1):
    if len(str(i)) % 2 == 0:
        continue
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

n = k()

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
i = 1
for _ in range(1,n+1):
    if i > n: break
    if len(str(i))%2!=0: 
        ans += 1
        i += 1
    else:
        i *= 10
print(ans)

Submission status: Accepted

Solution code:
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

n=I()
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):
    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:
def count(n):
    c = 1
    while(n>=10):
        n = n//10
        c += 1
    return c
s = 0
n = int(input()) 
x = count(n)-1
for i in range(0,x,+2):
    s += 9*(10**i)
if (x+1) % 2:
    s += n-pow(10,x)+1
print(s)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(1,N+1):
    for j in range(6):
        if 10 ** j <= i and i < 10**(j+1):
            if j % 2 == 0:
                ans += 1
                break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

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:
import sys

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
i=1

while i<=n:

    if len(str(i))%2==1:
        ans+=1

    i+=1

print(ans)

Submission status: Accepted

Solution code:
S = input()
slen = len(S)
S = int(S)
count = 0
for i in range(0,slen, 2):
    if ( i == slen-1):
        inv = 1 if i == 0 else 10 ** i
        count = count + (S-inv) + 1
        # print(i, (S-inv) + 1)
    else:
        count = count + 10 ** (i+1) - 10 ** (i)
        # print(i, 10 ** (i+1) - 1)
print(count)

Submission status: Accepted

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

if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
import sys, math
from collections import defaultdict
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

N = ri()

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

Submission status: Accepted

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

while True:
  if n == 0:
    break
  else:
    x = len(str(n))
    if x%2 == 1:
      c += 1
  n -= 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 = input()
ans = 0
for i in range(0,len(n)):
  if i % 2 == 1:
    max_num = 10 ** i 
    min_num = 10 ** (i-1)
    ans +=  max_num - min_num
if len(n) % 2 == 1:
  ans += int(n) - (10 ** (len(n)-1) - 1)
print(ans)

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

Submission status: Accepted

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

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());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 == 0: continue
    ans += 1
print(ans)