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

Solution (Python):

n = int(input())

ans = 0
if(n >= 100):
    ans += 9
    if(n >= 10000):
        ans += 900
        if(n >= 100000):
            ans += 90000
        else:
            ans += n-9999
    else:
        ans += min(n-99, 900)
else:
    ans += min(n,9)

print(ans)

Solution (Python):
N = int(input())

ans = 0
i = 0
while (N >= 10**i):
    if (i%2 == 1):
        ans += 10**i - 10**(i-1)
    i += 1
if (i%2 == 1):
    ans += N - 10**(i-1) + 1
print(ans)

Solution (Python):
N = int(input())


digit = len(str(N))
cnt = 0

for x in range(digit):
    x += 1
    if x % 2 != 0:
        if x < digit:
            cnt += (10**x) - (10**(x-1))
        else:
            cnt += N - (10**(x-1)) + 1

print('{}'.format(cnt))

Solution (Python):

if __name__ == "__main__":
    N = int(input())
    cnt = 0
    if N == 100000:
        cnt = 90000 + 900 + 9
    elif N >= 10000 and N < 100000:
        cnt = (N - 10000)+ 910
    elif N >= 1000 and N < 10000:
        cnt = 909
    elif N >= 100 and N < 1000:
        cnt = (N - 100)+ 10 
    elif N >=10 and N < 100:
        cnt = 9
    elif N < 10:
        cnt = N
    print(cnt)

Solution (Python):
N=int(input())
l=len(str(N))
if l==1:
  print(N)
elif l==2:
  print(9)
elif l==3:
  print(N-90)
elif l==4:
  print(909)
elif l==5:
  print(N-9090)
elif l==6:
  print(90909)

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

Solution (Python):
import numpy as np
def acinput():
    return list(map(int,input().split(" ")))


N=int(input())

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

print(count)

Solution (Python):
Nstr = input()
N = int(Nstr)

l = len(Nstr)

_sum = 0


if l % 2 == 1:
    _sum += (N - (10**(l-1)-1))
else:
    pass

for keta in range(1,l,2):
    if keta % 2 == 0:
        continue
    _sum += (10**(keta) -1) - (10**(keta-1) -1)

print(_sum)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys, math, bisect, random, itertools
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a, b, c = LI()
    print(min(b+c,a))
    return


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


def C():
    n = II()
    h = LI()
    h = h[::-1]
    for i in range(1, n):
        if h[i] <= h[i-1]:
            continue
        if h[i] == h[i - 1] + 1:
            h[i] -= 1
            continue
        print("No")
        return
    print("Yes")
    return


def D():
    s = S()
    lens = len(s)
    ans = [0] * len(s)
    i = 0
    while i != len(s):
        for j in range(i, lens):
            if s[j] == "R":
                continue
            break
        R = j - i
        for i in range(j, lens):
            if s[i] == "L":
                continue
            break
        else:
            i += 1
        L = i - j
        ans[j] = R // 2 + (L+1) // 2
        ans[j - 1] = L // 2 + (R+1) // 2

    print(*ans)
    return


def E():
    return


def F():
    return


if __name__ == '__main__':
    B()

Solution (Python):
N = int(input())
R = 0

if N < 10:
	print(N)

elif N < 100:
	print(9)

elif N < 1000:
	print(N -90)

elif N < 10000:
	print(999-90)

elif N < 100000:
	print(N - 9090)

else:
	print(99999 - 9090)

Solution (Python):
N_str = input()

ans = 0
if len(N_str) % 2 == 1:
    N = int(N_str)
    ans += N - 10**(len(N_str)-1) + 1

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

print(ans)

Solution (Python):
N = int(input())
answer = 0

for i in range(N):
    if (i + 1 >= 10 and i + 1 <= 99) or (i + 1 >= 1000 and i + 1 <= 9999) or i + 1 == 100000:
        pass
    else:
        answer += 1

print(answer)

Solution (Python):
N = int(input())
nm = len(str(N))-1
summ = 0
for i in range(nm):
    if i ==0:
      summ += 9
    elif i%2 ==0:
      summ += (10**(i+1)-10**(i))
if nm%2 == 0:
    summ += N-(10**nm)+1
print(summ)

Solution (Python):
M = input()
m = int(M)
N = list(M)
if len(N) == 1:
  print(m)
elif len(N) == 2:
  print(9)
elif len(N) == 3:
  print(9+(m-100)+1)
elif len(N) == 4:
  print(909)
elif len(N) == 5:
  print(909+(m-10000)+1)
elif len(N) == 6:
  print(90909)
elif m == 100000:
  print(90910)

Solution (Python):
n = input()

keta_num = len(n)
keta1 = 9
keta2 = 900
keta3 = 90000


if keta_num == 6:
    print(keta1+keta2+keta3)
elif keta_num == 5:
    print(int(n) - 10000+1+keta1+keta2)
elif keta_num == 4:
    print(keta1+keta2)
elif keta_num == 3:
    print(int(n)-100+1+keta1)
elif keta_num == 2:
    print(keta1)
elif keta_num == 1:
    print(int(n)-1+1)

Solution (Python):
N = int(input())
if N >= 0 and N < 10:
    print(N)
elif  N >= 10 and N < 100:
    print("9")
elif  N >= 100 and N <= 999:
    print(N-90)
elif  N >= 1000 and N <= 9999:
    print("909")
elif  N >= 10000 and N <= 99999:
    print(909+(N-9999))
elif N >= 100000:
    print("90909")

Solution (Python):
a = int(input())

count = 0

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

print(count)

Solution (Python):
n = int(input())
 
i = [10, 100, 1000, 10000,100000]
digit = 0
p = [0, 9, 9, 909, 909, 90909]
for j in i:
  if j > n:
    break
  else:
    digit += 1
 
if digit%2 == 1:
  print(p[digit])
elif digit == 0:
  print(n)
else:
  
  print(p[digit]+n-i[digit-1]+1)

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

while n > 0:
    if len(str(n)) % 2 == 0:
        n -= 1
        continue

    count += 1
    n -= 1

print(count)

Solution (Python):
N = int(input())

cont = 0

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

Solution (Python):
n = input()
number = int(n)
digit = int(len(n))
if digit == 6:
    print(90909)
elif digit == 5:
    print((number - 9999) + 909)
elif digit == 4:
    print(909)
elif digit == 3:
    print((number - 99) + 9)
elif digit == 2:
    print(9)
else:
    print(n)

Solution (Python):
N = int(input())
order = len(str(N))

if order == 2:
  print(9)
  
elif order == 4:
  print(909)
  
elif order == 6:
  print(90909)
  
elif order == 1:
  a = int(N)
  print(a)

elif order == 3:
  b = int(N) - 90
  print(b)

elif order == 5:
  c = 909 + int(N) - 10000 + 1
  print(c)

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    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

    return ans


if __name__ == '__main__':
    print(main())

Solution (Python):
n = int(input())
ln = len(str(n))
if ln == 1:
    print(n)
elif ln == 2:
    print(9)
elif ln == 3:
    print(n-99+9)
elif ln == 4:
    print(900+9)
elif ln == 5:
    print(n-9999+909)
elif ln == 6:
    print(90909)

Solution (Python):
S = input()
N = len(S)

if N == 1:
	print(S)
elif N == 2:
	print(9)
elif N == 3:
	A=int(S[0])
	B=int(S[1])
	C=int(S[2])
	print(((A-1)*100)+(B*10)+C+10)
elif N == 4:
	print(909)
elif N == 5:
	A=int(S[0])
	B=int(S[1])
	C=int(S[2])
	D=int(S[3])
	E=int(S[4])
	print(((A-1)*10000)+(B*1000)+(C*100)+(D*10)+E+910)
else:
	print(90909)

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

Solution (Python):


n = int(input())
digit = len(str(n))

if digit % 2 == 0:
        start_d = digit-1
        check = False
else:
        start_d = digit -2
        check = True
cn = 0
for d in range(start_d, 0, -2):
        mx = 10 ** d - 1
        mn = 10 ** (d-1) 
        cn += (mx - mn + 1)
        
if check:
        cn += n - 10**(digit-1) +1

print(cn)

Solution (Python):
import sys
n = sys.stdin.readline().rstrip()
n_int = int(n)
if len(n)==1:
    print(n)
elif len(n)==2:
    print(9)
elif len(n)==3:
    print(n_int - 99 + 9)
elif len(n)==4:
    print(909)
elif len(n)==5:
    print(n_int - 9999 + 909)
else:
    print(90909)

Solution (Python):
N = input()
a = len(N)

if a%2==0:
    b = 0
    for i in range(int(a/2)):
        b += 9*(10**(2*i)) 
else:
    c = 0
    for i in range(int((a-1)/2)):
        c += 9*(10**(2*i))
    d = int(N) - 10**(a-1) +1
    b = c+d
print(b)

Solution (Python):
a = int(input())
i = 1
cnt = 0
while i <= a:
  if len(str(i))%2 == 1:
    cnt += 1
  i += 1
 
print("{}".format(cnt))

Solution (Python):
n = int(input())
i=1
count = 0
while i <= n:
    a = list(map(int,list(str(i))))
    i=i+1
    if len(a)%2==1:
      count+=1
print(str(count))

Solution (Python):
N = int(input())
k = 0

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

Solution (Python):
N = int(raw_input())
cnt = 0

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

print(cnt)

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

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

Solution (Python):
N = int(input())
s = N
l = len(str(s))
ans = 0
for i in range(l):
    if (l - i) % 2 == 1:
        ans += N - 10 ** (l - i - 1)
    N = 10 ** (l - i - 1)
if l % 2 == 1:
    print(ans + 1)
else:
    print(ans)

Solution (Python):
N = input()
keta = len(N)

cnt = 0
for i in range(1, keta + 1):
    if i != keta:
        if i % 2 != 0:
            cnt += (10 ** i) - (10 ** (i - 1))
    else:
        if i % 2 != 0:
            cnt += int(N) - (10 ** (i - 1) - 1)

print(cnt)

Solution (Python):
a = int(input())

if a <= 9:
  print(a)
elif a <= 99:
  print(9)
elif a <= 999:
  print(9 + (a - 99))
elif a <= 9999:
  print(9 + 900)
elif a <= 99999:
  print(9 + 900 + (a - 9999))
else:
  print(9 + 900 + 90000)

Solution (Python):
N = int(input())

resp = 0
if N < 10:
    resp = N
elif 10 <= N < 100:
    resp = 9
elif 100 <= N < 1000:
    a = 9
    b = N - 99
    resp = a + b
elif 1000 <= N < 10000:
    resp = 9 + (999 - 99)
elif 10000 <= N < 100000:
    a = 9
    b = 999 - 99
    c = N - 9999
    resp = a + b + c
elif 100000 <= N:
    resp = 90909

print(resp)

Solution (Python):


''' 
------------------------
author : iiou16
------------------------
'''

def main():
    N = int(input())

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


if __name__ == '__main__':
    main()

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

Solution (Python):
N = int(input())
keta = len(str(N))
cnt = 0
for i in range(keta):
  if i%2 == 1:
    cnt += 9*10**(i-1)

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

Solution (Python):
N = input()
length = len(N)
N = int(N)

if length == 1:
  print(N)
elif length == 2:
  print(9)
elif length == 3:
  print(N-90)
elif length == 4:
  print(909)
elif length == 5:
  print(N-9090)
else:
  print(90909)

Solution (Python):
n = int(input())

if 1<=n and n<10: ans = n
elif 10<=n and n<100: ans = 9
elif 100<=n and n<1000: ans = 9+(n-99)
elif 1000<=n and n<10000: ans = 909
elif 10000<=n and n<100000: ans = 909+(n-9999)
elif n==100000: ans = 90909

print(ans)

Solution (Python):
n = int(input())
ans = 0
if n < 10:
  ans = n
elif n < 10**2:
  ans = 9 
elif n < 10**3:
  ans = n - 90
elif n < 10**4:
  ans = 909
elif n < 10**5:
  ans = n - 9090
else:
  ans = 90909
print(ans)

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

Solution (Python):
n = input()

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

Solution (Python):
n=int(input())
s=0

l=len(str(n))
for i in range(0,l-1):
    if i%2==0:
        s=s+(10**(i+1)-10**(i))
    else:
        continue
if l%2==1:
    m=n-10**(l-1)+1
    print(m+s)
else:
    print(s)

Solution (Python):
N = int(input())
 
i=1
x = 0
 
while True:
  m = 10 ** i - 1
  if N <= m:
    x += max((N - (10 ** (i-1) - 1)), 0)
    break
  x += (m - (10 ** (i-1) - 1))
  i += 2
print(x)

Solution (Python):
n = int(input())
ans = 0
keta = 1
if(n // 10 == 0):
    ans = n
else:
    ans += 9
    for i in range(2, 5, 2):
        now = n // (10 ** i)
        if now < 10 and now > 0:
            ans += (now - 1) * 10 ** i + n % 10 ** i + 1
        if now >= 10:
            ans += 10 ** i * 9
print(ans)

Solution (Python):
N = int(input())

if 0 <= N < 10:
  print(N)
elif 10 <= N < 100:
  print(9)
elif 100 <= N < 1000:
  print(9 + N - 99)
elif 1000 <= N < 10000:
  print(909)
elif 10000 <= N < 100000:
  print(909 + N - 9999)
elif N == 100000:
  print(90909)

Solution (Python):
N = int(input())

j = 1
Ans = 0
Q = 1
n = N

while n > 0:
    if n >= 10:
        if j == 1:
            Ans += 9 * Q
    else:
        if j == 1:
            Ans += N - Q + 1
    n = n // 10
    j = j * (-1)
    Q = Q * 10

print(Ans)

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

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

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

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


if __name__ == '__main__':
  main()

Solution (Python):
n = int(input())

r=len(list(filter(lambda x: len(str(x))%2 != 0, range(1,n+1))))

print(r)

Solution (Python):
n = int(input())
ans = 0
ten = 10**(len(str(n))-1)
if len(str(n)) % 2:
    ans += n-ten+1
n = ten
while n > 10:
    ten = 10**(len(str(n))-2)
    if len(str(n)) % 2 == 0:
        ans += n-ten
    n = ten 
 
if n >= 10:
    ans += 9
print(ans)

Solution (Python):
values = input().split(' ')
value = int(values[0])

sum = 0
for x in reversed(range(1, value+1)):
  if( len(list(str(x))) % 2 == 0): 
    continue
    print("hoge")
  sum = sum + 1


print(sum)

Solution (Python):
num = input()
ans = [9,0,900,0,90000]
tmp = 0

if len(num)%2==0:
  tmp = sum(ans[:len(num)])
elif len(num)==1:
  tmp = num
else:
  tmp += sum(ans[:len(num)-2])
  tmp += int(num)-10**(len(num)-1)+1

print(tmp)

Solution (Python):


n = int(input())

cnt = 0
a = 1
while True:
  if n < a:
    break
  elif n < a * 10:
    cnt += n - a + 1
    break
  else:
    cnt += 9 * a
    a *= 100
print(cnt)

Solution (Python):
def hasOddDigits(num):
    s = str(num)
    return len(s) % 2 == 1


N = int(input())

counter = 0
for i in range(1, N+1):
    if hasOddDigits(i):
        counter += 1


print(counter)

Solution (Python):
n = int(input())
kotae = 0
if n == 100000:
  kotae = 90909
elif n >= 10000:
  kotae = 909 + (n - 10000 + 1)
elif n >= 1000:
  kotae = 909
elif n >= 100:
  kotae = 9 + (n- 100 +1)
elif n >= 10:
  kotae = 9
else:
  kotae = n
print(kotae)

Solution (Python):
"""


 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())


 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  


a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654


char_list = list("abcd") 
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    n = int(input())
    k = len(str(n))
    c=0
    for i in range(k-1):
        if i % 2 ==0:
            c+=9*(10**i)
    if k % 2 !=0:
        c+=n-10**(k-1)+1
    print(c)

Solution (Python):
N = str(input())


length = len(N)


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

Solution (Python):
from math import log10, floor
n = int(input())
l = log10(n)
if floor(l)%2 :
    s = 0
    for i in range(floor(l)) :
        if (i+1)%2 :
            s += 9*10**i
else :
    s = 0
    for i in range(floor(l)) :
        if (i+1)%2 :
            s += 9*10**i
    s += n-10**floor(l)+1
print(s)

Solution (Python):
N = int(input())

cnt = 0

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

print(cnt)

Solution (Python):
n = input()
if len(n) == 1:
    print(n)
elif len(n) == 2:
    print(9)
elif len(n) == 3:
    print(9 + int(n) - 99)
elif len(n) == 4:
    print(9 + 900)
elif len(n) == 5:
    print(9 + 900 + int(n) - 9999)
elif len(n) == 6:
    print(9 + 900 + 90000)

Solution (Python):
tmp = input()
l = len(tmp)
N = int(tmp)

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

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


print(ans)

Solution (Python):
N = int(input())
for i in range(N):
    if 10 **i <= N < 10 ** (i+1):
        keta_10 = i+1
        break
total = 0
if keta_10 % 2 == 0 :
    for k in range(1, keta_10 + 1):
        if k % 2 == 1:
            total = total + 9 * (10**(k-1))
else:
    for k in range(1, keta_10 + 1 - 2):
        if k % 2 ==1:
            total = total + 9 * (10**(k-1))
    total = total + N - 10 ** i + 1

print(total)

Solution (Python):
n = int(input())

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

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

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

Solution (Python):
N = int(input())
count = 0
for i in range(N):
  r = N - i
  digit = len(str(r))
  if digit % 2 == 1:
    count += 1
print(count)

Solution (Python):

N = int(input())

ans = 0
if N < 10:
    ans = N
elif N < 100:
    ans = 9
elif N < 1000:
    ans += 9
    ans += max(0, N - 99)
elif N < 10000:
    ans += 9 + 900
elif N < 100000:
    ans += 9 + 900
    ans += max(0, N - 9999)
else:
    ans += 9 + 900 + 90000

print(ans)

Solution (Python):
a=int(input())

s=0
if a<10:
    s=a
elif a<100:
    s=9
elif a<1000:
    s=9+(a-99)
elif a<10000:
    s=909
elif a<100000:
    s=909+(a-9999)
else:
    s=90909

print(s)

Solution (Python):
N = int(input())

result = 0

for i in range(1,N+1):
    if i < 10 :
        result += 1
        
    elif 100 <= i < 1000:
        result += 1
    
    elif 10000 <= i < 100000:
        result += 1
        
print(result)

Solution (Python):
N=int(input())
keta=len(str(N))

sum = 0
if keta%2==0: 
  kaisuu = keta//2
  for i in range(kaisuu):
    sum = sum + 9 * (10 ** (i*2))
else: 
  if keta == 1:
    sum = N
  else:
    kaisuu = (keta-1)//2
    for i in range(kaisuu):
      sum = sum + 9 * (10 ** (i*2))
    sum = sum + (N - ((10 ** (keta-1)) - 1))

print(sum)

Solution (Python):
n = int(input())
if 1 <= n <= 9:
  print(n)
elif 10 <= n <= 99:
  print(9)
elif 100 <= n <= 999:
  print(n - 90)
elif 1000 <= n <= 9999:
  print(909)
elif 10000 <= n <= 99999:
  print(n - 9090)
else:
  print(90909)

Solution (Python):
import sys
n=int(input())

oddn=0
if n<10:
  oddn+=n
  print(oddn)
  sys.exit()
else:
  oddn+=9
if n<100:
  print(oddn)
  sys.exit()
  
if n<1000:
  oddn+= n-99
  print(oddn)
  sys.exit()
else:
  oddn+=900

if n>=10000:
  oddn+=n-9999
if n==100000:
  oddn-=1

print(oddn)

Solution (Python):

N = int(input())
if N == 100000:
  x = 90909
elif N >= 10000:
  x = 909 + N - 10000 + 1
elif N >= 100:
  if N >= 1000:
    x = 909
  else:
    x = 9 + N - 100 + 1
elif N >= 1:
  if N >= 10:
    x = 9
  else:
    x = N
    
print(x)

Solution (Python):
N = int(input())						


ans = 0


if 1<=N<=9:
	ans += N


if 10<=N:
	ans += 9


if 100<=N<=999:
	ans += N-99


if 1000<=N:
	ans += 900


if 10000<=N<=99999:
	ans += N-9999



if 100000<=N:
	ans += 90000


print(ans)

Solution (Python):
n = int(input())

cnt = 0
i = 1
while i <= n:
    j = i * 10
    if j > n + 1:
        j = n + 1
    cnt += j - i
    i = j * 10
print(cnt)

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

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

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

print(ans)

Solution (Python):
N = int(input())
ct = 0
for i in range(N):
  k = i+1
  order = 0
  while(k>0):
  	order += 1
  	k //= 10
  if(order % 2 != 0):
    ct += 1
print(ct)

Solution (Python):
N = int(input())
a = 0

if N < 10:
    a = N
elif 10 <= N <100:
    a = 9
elif 100 <= N < 1000:
    a = N - 90
elif 1000 <= N < 10000:
    a = 909
elif 10000 <= N < 100000:
    a = N - 9090
else :
    a = 90909

print(a)

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

Solution (Python):
n = input().strip()
nLen = len(n)
n = int(n)
ans = 0
if nLen == 1:
    ans = n
elif nLen == 2:
    ans = 9
elif nLen == 3:
    ans = n - 99 + 9
elif nLen == 4:
    ans = 9 + 900
elif nLen == 5:
    ans = n - 9999 + 900 + 9
elif nLen == 6:
    ans = 90909
print(ans)

Solution (Python):
N = int(input())

if N < 10:
  print(N)
elif N < 100:
  print(9)
elif N < 1000:
  print(9 + (N - 99))
elif N < 10000:
  print(909)
elif N < 100000:
  print(909 + (N - 9999))
else:
  print(90909)

Solution (Python):
n=int(input())
if n==100000:print(90909)
elif 9999<n and n<100000:print(n-9090)
elif 999<n and n<10000:print(909)
elif 99<n and n<1000:print(n-90)
elif 9<n and n<100:print(9)
else:print(n)

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

if n <= 9:
    ans = n

elif 10 <= n <= 99:
    ans = 9

elif 100 <= n <= 999:
    ans = n - 90

elif 1000 <= n <= 9999:
    ans = 909

elif 10000 <= n <= 99999:
    ans = n - 9090

elif 100000 <= n <= 999999:
    ans = 90909

print(ans)

Solution (Python):
n = input()
l = len(n)

if l == 1:
  print(n)
elif l%2==1:
  tmp = sum([(10**(i-1))*9 for i in range(1, l, 2)])
  ans = tmp+ (int(n)-10**(l-1)+1)
  print(ans)
else:
  ans = sum([(10**(i-1))*9 for i in range(1, l, 2)])
  print(ans)

Solution (Python):
N = input()
n=int(N)
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(909+n-9999)
else:
    print(90909)

Solution (Python):
N=int(input())

s=len(str(N))

ret=0
for i in range(1,s+1):
    if i%2==0:
        continue
    if(i==s):
        ret+=N-10**(i-1)+1
    else:
        ret+=9*10**(i-1)

print(ret)

Solution (Python):
N = int(input())
N_keta = len(str(N))
ans = 0
if N_keta % 2 == 1:
  ans += N-10**(N_keta-1)+1
  for keta in range(N_keta-1,0,-1):
    if keta % 2 == 1:
      ans += (10**keta-1)-(10**(keta-1))+1
else:
  for keta in range(N_keta-1,0,-1):
    if keta % 2 == 1:
      ans += (10**keta-1)-(10**(keta-1))+1

print(ans)

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

Solution (Python):
def func(len_a):
    ans = ""
    for i in range(1, len_a):
        if i & 1 == 0:
            ans += "0"
        elif i & 1 == 1:
            ans += "9"
    return ans

def main():
    a = input()
    len_a = len(a)
    if len_a & 1 == 0:
        ans = func(len_a)
        print(ans)
    else:
        if len_a == 1:
            print(a)
        else:
            ans = int(func(len_a-1))
            ans = ans + ( int(a) - 10 ** (len_a-1) ) + 1
            print(ans)


main()

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

Solution (Python):
n = int(input())

ans = 0

if n < 9:
    ans = n
elif n >= 9 and n < 100:
    ans = 9
elif n >= 100 and n < 999:
    ans = 9 + (n - 100 + 1)
elif n >= 999 and n < 10000:
    ans = 9 + 900
elif n >= 10000 and n < 99999:
    ans = 9 + 900 + (n - 10000 + 1)
else:
    ans = 9 + 900 + 90000

print(ans)

Solution (Python):
n = int(input())
cnt = 0
for k in range(1,n+1):
    if k >= 1 and k <= 9:
        cnt += 1
    elif k >= 100 and k <= 999:
        cnt += 1
    elif k >= 10000 and k <= 99999:
        cnt += 1
print(cnt)

Solution (Python):
N = int(input())
ans = 0
for i in range(len(str(N))):
    if i % 2 != 0:
        continue
    if i == len(str(N)) - 1:
        ans += N - 10 ** i + 1
    else:
        ans += 9 * 10 ** i
print(ans)

Solution (Python):
n = input()

ans = 0

while True:
    if len(n) == 0:
        break
    if len(n) == 1:
        ans = ans + int(n)
    elif len(n) % 2 != 0:
        ans = ans + int(n) - int((len(n) - 1) * '9')
    n = (len(n) - 1) * '9'

print(ans)

Solution (Python):
N = int(input())

if 0 < N < 10:
  print(N)
elif 10 <= N <100:
  print(9)
elif 100 <= N < 1000:
  print(9 + N - 100 + 1)
elif 1000 <= N < 10000:
  print(909)
elif 10000<= N < 100000:
  print(909 + N - 10000 + 1)
else:
  print(90909)

Solution (Python):
import numpy as np

N = int(input())

n = N

count = 0

num = 0

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

if(int(n) != 0):
	n = N - (10 ** count) + 1

for i in range(count + 1):
    if(i % 2 == 1):
        num = num + (0.9 * (10 ** i))

if(count % 2 == 0):
    num = num + n

print(int(num))

Solution (Python):
N=int(input())
import math
if 0<=math.log10(N)<1:
  print(N)
elif 1<=math.log10(N)<2:
  print(9)
elif 2<=math.log10(N)<3:
  print(N-90)
elif 3<=math.log10(N)<4:
  print(909)
elif 4<=math.log10(N)<5:
  print(N-9090)
elif 5<=math.log10(N):
  print(90909)

Solution (Python):
import numpy as np

def main():
    n = int(input())
    count = 0
    for num in range(1, n+1):
        keta = int(np.log10(num))+1
        if keta % 2 != 0:
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Solution (Python):


N = input()

sum = 0
for i in range(1, len(N) + 1, 2):

    if int(N) >= 10 ** i:
        sum += (10**i - 1) - (10**(i - 1) - 1)
    else:
        sum += int(N) - (10**(i - 1) - 1)

print(sum)

Solution (Python):
n = int(input())
if n <= 9:
  print(n)
else:
  if n <= 99:
    print(9)
  else:
    if n <= 999:
      print(n - 90)
    else:
      if n <= 9999:
        print(909)
      else:
        if n <= 99999:
          print(n - 9090)
        else:
          print(90909)

Solution (Python):
N = int(input())
if N < 10:
    ans = N
elif N < 100:
    ans = 9
elif N < 1000:
    tmp = N - 100 + 1
    ans = tmp + 9
elif N < 10**4:
    ans = 909
elif N < 10**5:
    tmp = N - 10**4 + 1
    ans = tmp + 909
else:
    ans = 90909
print(ans)

Solution (Python):
n=int(raw_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-90-9000)
else:
    print 90909

Solution (Python):
N = int(input())

if N <= 9:
  print(N)
elif N <= 99:
  print('9')
elif N <= 999:
  print(N - 90)
elif N <= 9999:
  print('909')
elif N <= 99999:
  print(N - 9090)
else:
  print('90909')

Solution (Python):
def main():
    n = int(input())
    ans = 0
    if n >= 10000:
        max_n = 99999 if n >= 100000 else n
        ans += max_n - 9999
    if n >= 100:
        max_n = 999 if n >= 1000 else n
        ans += max_n - 99
    if n >= 1:
        max_n = 9 if n >= 10 else n
        ans += max_n
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
if N <= 99:
  num = min(N, 9)
elif N <= 9999:
  num = 9 + min(N-99, 999-99)
elif N <= 999999:
  num = 909 + min(N-9999, 99999-9999)
print(num)

Solution (Python):
n = int(input())
s = 0
if n < 10:
  s = n
if (n >= 10) & (n < 100):
  s = 9
if (n >= 100) & (n < 1000):
  s = 9 + n - 100 + 1
if (n >= 1000) & (n < 10000):
  s = 909
if (n >= 10000) & (n < 100000):
  s = 909 + n - 10000 + 1
if n == 100000:
  s = 90909
print(s)

Solution (Python):
n = int(input())

if n <= 9:
    print(n)
elif 9 < n <= 99:
    print(9)
elif 99 < n <= 999:
    print(n - 90)
elif 999 < n <= 9999:
    print(909)
elif 9999 < n <= 99999:
    print(n - 9090)
else:
    print(90909)

Solution (Python):


import math

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

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

def main():
    n = read_int()
    keta = math.floor(math.log10(n)) + 1
    ans = 0
    for i in range(1, keta):
        if i % 2 == 0:
            continue
        else:
            plus = ( 10 ** i ) - (10 ** (i-1))
            ans += plus
    if keta % 2 == 1:
        ans += n - (10 ** (keta - 1)) + 1
    print(ans)

main()

Solution (Python):
n = int(input())
count = 0
for i in range(1, n+1):
    if 10 <= i <= 99 or 1000 <= i <= 9999 or i == 100000:
        continue
    count += 1
print(count)

Solution (Python):
n=int(input())
keta=len(str(n))
count=0
i=1







if keta%2!=0:
	count+=n-10**(keta-1)+1
	keta-=1
while keta-i>=0:
		count+=10**i-10**(i-1)
		i+=2
print(count)