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):
def intget():
    return int(input())



n = intget()

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

print(sum)

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

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

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

def rtnm(n,st):
    ans = 0
    for i in range(st,st*10):
        if(i > n):
            break
        else:
            ans += 1
    return ans

ans = 0

ans += rtnm(n,10**4) + rtnm(n,10**2) + rtnm(n,10**0)
        
print(ans)

Solution (Python):
num_str = input().strip()
number = int(num_str)

if len(num_str) == 1:
    print(number)
elif len(num_str) == 2:
    print(9)
elif len(num_str) == 3:
    print(number - 100 + 1 + 9)
elif len(num_str) == 4:
    print(909)
elif len(num_str) == 5:
    print(number - 10000 + 1 + 900 + 9)
elif len(num_str) == 6:
    print(90909)
exit(0)

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

Solution (Python):
N = int(input())
ans = 0
keta = 0
count = 10**keta
for i in range(1, N+1):
  count = 0
  keta = 0
  while count <= i:
    keta +=1
    count = 10**keta
  keta -=1
  if keta %2==0:
    ans += 1

print(ans)

Solution (Python):
N = int(input())
ans = 0
if 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())
a=0
c=0
while a<=N:
  if (1<=a and a<=9) or (100<=a and a<=999) or (10000<=a and a<=99999):
    c+=1
    a+=1
  else:
    a+=1
print(c)

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

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

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

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

print(k)

Solution (Python):
N = int(input())
tmp = 10
i = 0
ans = 0
while tmp <= N:
  if i%2 ==0:
    ans += 9*(10**i)
  i += 1
  tmp = 10**(i+1)
if i%2 == 0:
  ans += N-10**i+1
print(ans)

Solution (Python):
N=input()
lenN=len(N)
ans=0

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

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

keta = len(str(n))
index = 1
count = 0
while index < keta:
    count += 9 * (10 ** (index-1))
    index += 2

if index <= keta:
    count += n - (10 ** (index-1)) + 1

print(count)

Solution (Python):
N = int(input())
if len(str(N)) == 6:
  print(9+900+90000)
elif len(str(N)) == 4:
  print(9+900)
elif len(str(N)) == 2:
  print(9)
elif len(str(N)) == 5:
  print(9+900+N-10000+1)
elif len(str(N)) == 3:
  print(9+N-100+1)
elif len(str(N)) == 1:
  print(N)

Solution (Python):
def NDigit():
    N = int(input())
    if N < 10: return N
    elif N < 100: return 9
    elif N < 1000: return (N - 90)
    elif N < 10000: return 909
    elif N < 100000: return (N - 9090)
    else : return 90909


print(NDigit())

Solution (Python):
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)

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

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

print(c)

Solution (Python):
import sys,heapq,math,resource
from collections import deque,defaultdict
printn = lambda x: sys.stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True 
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def setrlim():
  sys.setrecursionlimit(250000)
  soft,hard = resource.getrlimit(RLIMIT_STACK)
  
  

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

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

Solution (Python):
n = input()

keta = len(n)

if keta%2 == 0:
    result = 0
    for i in range(keta-1):
        if i%2 == 1:
            pass
        else:
            result += 9*10**i
else:
    result = 0
    for i in range(keta - 2):
        if i % 2 == 1:
            pass
        else:
            result += 9 * 10 ** i
    result += int(n) - 10**(keta-1) + 1

print(result)

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

x = [(len(str(i)) % 2) for i in range(1, N+1)]
print(sum(x))

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

cnt = 0

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

print(cnt)

Solution (Python):
import math

N = int(input())
n = int(math.log10(N))

if n % 2 == 1:
    m = n // 2
    print((100 ** (m + 1) - 1) // 11)
else:
    m = n // 2
    val = (100 ** m - 1) // 11
    print(val + N - 100 ** m + 1)

Solution (Python):
import decimal
decimal.getcontext().prec = 100
def sum1(pre,l,r):
    l=max(l,0)
    if(l==0):
        return pre[r]
    return pre[r] - pre[l - 1]

x=int(raw_input())
ans=0
if(x<=9):
    ans=x
elif(x>=10 and x<100):
    ans=9
elif(x>=100 and x<1000):
    ans=9+x-99
elif(x>=1000 and x<10000):
    ans=9+900
elif(x>=10000 and x<100000):
    ans=9+900+x-9999
elif(x>=100000):
    ans=9+900+90000
print ans

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

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

Solution (Python):
if __name__ == "__main__":
    N = int(input())

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

    print(count)

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

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

if (len == 1):
    print(n)
    exit
elif(len == 2):
    print(9)
    exit
elif(len == 3):
    print(9 + num-100+1)
    exit
elif(len == 4):
    print(909)
    exit
elif(len==5):
    print(909 + num-10000+1)
    exit
elif(len==6):
    print(90909)
    exit

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

if 1 <= n <= 8:
    print(n)

elif 9 <= 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):



def num(l, r, n):
    r = min(r, n)
    if r >= l:
        return r - l + 1
    else:
        return 0


def solv(n):
    return num(1, 9, n) + num(100, 999, n) + num(10000, 99999, n)


if __name__ == '__main__':

    N = int(input())

    ans = solv(N)

    print(ans)

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

Solution (Python):
import sys
input = sys.stdin.readline

n = int(input())
n_len = len(str(n))
if n_len == 1:
    cnt = n
elif n_len == 2:
    cnt = 9
elif n_len == 3:
    cnt = 9 + n-99
elif n_len == 4:
    cnt = 909
elif n_len == 5:
    cnt = 909 + n-9999
else:
    cnt = 90909
print(cnt)

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

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

Solution (Python):

n = str(input())
int_n = int(n)


ans = 0
for i in range(1,len(n)+1):
    if i%2==1:
        if i==len(n):
            ans += int_n - 10**(i-1) + 1
        else:
            ans += 10**(i)-10**(i-1)
        
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

def main():
  n = int(input())
  c = 0
  
  for i in range(n):
    x = i
    x += 1
    if x < 10:
      c += 1
    elif x >= 100 and x < 1000:
      c += 1
    elif x >= 10000 and x < 100000:
      c += 1
      
  print(c)




if __name__ == '__main__':
  main()

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(sys.stdin.readline())

    if N < 10:
        print(N)
    elif 10 <= N <= 99:
        print(9)
    elif 99 < N <= 999:
        print(9 + (N - 99))
    elif 999 < N <= 9999:
        print(9 + 900)
    elif 9999 < N <= 99999:
        print(909 + (N - 9999))
    else:
        print(90909)

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

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

if n < 10**1:
  print(n)
elif n < 10**2:
  print(9)
elif n < 10**3:
  print(9 + n - 10**2 + 1)
elif n < 10**4:
  print(909)
elif n < 10**5:
  print(909 + n - 10 **4 + 1)
else:
  print(90909)

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

Solution (Python):


import math

n = int(input())
a = int(math.log10(n))
cnt = 0
for i in range(a):
    if (i + 1) % 2 == 1:
        cnt += 10 ** (i + 1) - 10 ** i

if (a + 1) % 2 == 1:
    cnt += n - 10 ** a + 1

print(cnt)

Solution (Python):
from math import log10, floor
n=int(input())

tmp=floor(log10(n))
ans=0
for i in range(tmp):
    if i%2==0:
        ans+=9*10**i
if tmp%2==0:
    ans+=n-10**tmp+1
print(ans)

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

keta = len(str(N))

if keta == 1:
  print(N)
elif keta == 2:
  print(9)
elif keta == 3:
  print(N-90)
elif keta == 4:
  print(909)
elif keta == 5:
  print(N-90-9000)
elif keta == 6:
  print(90909)

Solution (Python):
n = int(input())
cnt = 0
for i in range(1, n+1):
    string = str(i)
    if i == 10**5:
        pass
    elif i >= 10** 4:
        cnt += 1
    elif i >= 10 **3:
        pass
    elif i >= 10 ** 2:
        cnt += 1
    elif i >= 10:
        pass
    else:
        cnt += 1
print(cnt)

Solution (Python):
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(909)
elif 10000 <= N < 100000:
    print(909 + N - 9999)
elif 100000 <= N < 1000000:
    print(90909)

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

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

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

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

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

digit = len(str(N))



is_even = digit % 2 == 1


count = 0

for i in range(digit//2):
    count += 9 * 10**(2*i)
    

if is_even:
    count += N - 10**(digit-1) + 1
    

print(count)

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

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

c=0
for i in range (1, N+1):
    i_list=list(str(i))
    digit=len(i_list)
    if digit%2==1:
        c+=1
    else: continue
        
print(c)

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

def answer(N):
    ans=0
    if N<10:
        return N
    ans += 9
    if N<100:
        return ans
    if N<1000:
        return ans + N-99
    ans += 900

    if N<10000:
        return ans
    ans += N-9999
    if N==100000:
        ans -=1
        
    return ans



print(answer(N))

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

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

if len(sN) % 2 == 1:
    ans += N - 10**(len(sN) - 1) + 1

print(ans)

Solution (Python):
from sys import stdin

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

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

if digit % 2 == 1:
    ans += N - 10 ** (digit - 1) + 1

print(ans)

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

Solution (Python):
a=int(input())
ans=-1
for i in range(a+1):
  if len(str(i))%2 == 1:
    ans+=1

print(ans)

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

N = int(N)

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

    if keta % 2 == 0:
        continue
    else:
        cnt += 1


print(cnt)

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

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

num = [9, 0, 900, 0, 90000]

def main():
    n = ri()
    ans = 0
    for d in range(6):
        m = pow(10, d+1)
        if n < m:
            if d % 2 == 0:
                ans += n%m - (m//10-1)
            break
        else:
            ans += num[d]
    print(ans)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
a=0
N=int(input())
if N<10:
    a=N
elif N<100:
    a=9
elif N<1000:
    a=N-90
elif N<10000:
    a=909
elif N<100000:
    a=N-9090
else:
    a=90909
print(a)

Solution (Python):


n = int(input())

ans = 0
for i in range(n):
    if 1 <= i + 1 <= 9:
        ans += 1
    elif 100 <= i + 1 <= 999:
        ans += 1
    elif 10000 <= i + 1 <= 99999:
        ans += 1
    elif 1000000 <= i + 1 <= 9999999:
        ans += 1

print(ans)

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

count = 0

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

print(count)

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

if n1 < 10:
    print(n1)
elif n1 <= 99:
    print(9)
elif n1 < 1000:
    print(9 + (n1 - 99))
elif n1 <= 9999:
    print(909)
elif n1 < 100000:
    print(909 + (n1 - 9999))
else:
    print(90909)

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

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

l = len(N)

if l <= 1:
	print(int(N))
elif l == 2:
	print(9)
elif l == 3:
	print(int(N[0]) * 100 + int(N[1]) * 10 + int(N[2]) - 90)
elif l == 4:
	print(999 - 90)
elif l == 5:
	print(int(N[0]) * 10000 + int(N[1]) * 1000 + int(N[2]) * 100 + int(N[3]) * 10 + int(N[4]) - 90 - 9000)
else:
	print(90909)

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

if A<10:
    kotae=A
elif 10<=A<100:
    kotae=9
elif 100<=A<1000:
    kotae=A-90
elif 1000<=A<10000:
    kotae=909
elif 10000<=A<100000:
    kotae=A-9090
elif A==100000:
    kotae=90909
print(kotae)

Solution (Python):
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)

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

Solution (Python):
n=input()
s=len(n)
n=int(n)
k=9
ans=0
if s==2: print(9)
elif s==4: print(909)
elif s==6: print(90909)
else:
  if s==1: print(n)
  elif s==3: print(9+n-99)
  elif s==5: print(909+n-9999)

Solution (Python):
import numpy as np
import math
import sys
sys.setrecursionlimit(10000000)

def main():
    N = int(input())
    num = 0
    if 1 <= N and N <= 9:
        num = N
    elif 10 <= N and N <= 99:
        num = 9
    elif 100 <= N and N <= 999:
        num = N - 90
    elif 1000 <= N and N <= 9999:
        num = 909
    elif 10000 <= N and N <= 99999:
        num = N - 9090
    else:
        num = 90909
    print(num)


if __name__ == '__main__':
    main()

Solution (Python):

N = input()
d = len(N)
num = int(N)
e = d//2
if d%2 == 0:
    if e == 1:
        ans = 9
    elif e == 2:
        ans = 9 + 999-99
    else:
        ans = 9 + 999-99 + 99999-9999
else:
    if e == 0:
        ans = num
    elif e == 1:
        ans = 9 + num-99
    else:
        ans = 9 + 999-99 + num-9999

print(ans)

Solution (Python):


N = int(input())

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

print(res)

Solution (Python):
n = int(input())
s = len(str(n))
if s == 1:
    print(n)
elif s == 2:
    print(9)
elif s == 3:
    print(9 + (n-100) + 1)
elif s == 4:
    print(9 + 900)
elif s == 5:
    print(9 + 900 + (n-10000) + 1)
else:
    print(9 + 900 + 90000)

Solution (Python):
n=int(input())
if n==100000:
    print(90909)
elif n<100:
    print(min(9,n))
elif n<1000:
    print(9+(n-99))
elif n<10000:
    print(909)
else:
    print(909+(n-9999))

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

Solution (Python):

"""
Created on Sat Apr 20 20:47:47 2019

@author: Owner
"""

import numpy as np
import sys
import collections
import scipy.misc
import math
from operator import itemgetter
import itertools
import copy
import bisect
import heapq


def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]
    

"""
N, X = map(int, input().split())

x = list(map(int, input().split()))

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())


dp = np.zeros((N+1, 4,4,4))
    
all(nstr.count(c) for c in '753')


ABT = zip(A, B, totAB)
result = 0

sorted(ABT,key=itemgetter(2))
A, B, totAB = zip(*ABT)
A.sort(reverse=True)


(x >> i) & 1


dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

add = 1 
res = 0
sums = [0]*(len(nums)+1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]
for i in range(0, len(nums), 2):
    left = i
    right = min(i+add, len(nums))
    tmp = sums[right] - sums[left]
    res = max(tmp, res)


li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    


org_list = [3, 1, 4, 5, 2]
new_list = sorted(org_list)
print(org_list)
print(new_list)




    for h in range(0,H):
        for w in range(0,W):
            if h == 0 and w == 0:
                pass
            elif h == 0:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h-1][W-w]+1)
            elif w == 0:   
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1)
            else:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1, D[H-h-1][W-w]+1, D[H-h][W-w]+2)
            d_max = max(D[H-h-1][W-w-1], d_max)

"""


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

    
if __name__ == '__main__':
    main()

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

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

Solution (Python):
n = input()

s = len(n)

ans = 0


if s == 1:
    print(int(n))
    exit()

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

if s %2 != 0:
    ans += int(n) - (10**(s-1))+1

print(ans)

Solution (Python):




n = int(input())


ans = 0
for i in range(1, n+1):
    if i < 10 or (i > 99 and i < 1000) or (i > 9999 and i < 100000):
        ans = ans + 1


print(ans)

Solution (Python):
def resolve():

    n = int(input())

    ans = 0

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

    print(ans)
    
resolve()

Solution (Python):


import os
import sys

N = int(input())

if N < 10:
	print(N)

elif N < 100:
	print(9)

elif N < 1000:
	print(9 + N - 99)

elif N < 10000:
	print(9 + 999 - 99)

elif N < 100000:
	print(9 + 900 + N - 9999)

elif N == 100000:
	print(9 + 900 + 90000)

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(909)
elif len(N) == 5:
    print(909 + int(N) - 9999)
elif len(N) == 6:
    print(90909)

Solution (Python):
N = int(input())
ans = 0
for i in range(1,N+1):
    if i<10 or (i>99 and i<1000) or (i>9999 and i<100000):
        ans += 1
    
print(ans)

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

cnt = 0
for i in range(1, N + 1):
    if N // 10**5:
        cnt = 90909
    elif N // 10**4:
        cnt = (N - 10**4 + 1) + 900 + 9
    elif N // 10**3:
        cnt = 900 + 9
    elif N // 10**2:
        cnt = (N - 10**2 + 1) + 9
    elif N // 10:
        cnt = 9
    else:
        cnt = N
print(cnt)

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

Solution (Python):
def INT(): return int(input())


def main():
    N = INT()
    count = 0

    for i in range(N):
        if len(str(i+1)) == 1 or len(str(i+1)) == 3 or len(str(i+1)) == 5:
            count += 1

    print(count)

if __name__ == '__main__':
    main()

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

if N==100000:
  print(90000+900+9)
elif N>=10000:
  print(N-10000+1+900+9)
elif N>=1000:
  print(909)
elif N>=100:
  print(N-100+1+9)
elif N>=10:
  print(9)
else:
  print(N)

Solution (Python):
n = int(input())
count = 0
for i in range(n+1):
    if 1 <= i <= 9 or 100 <= i <= 999 or 10000 <= i <= 99999:
        count += 1
print(count)

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

Solution (Python):
def uneven_numbers(N: int)->int:
    if N < 10:
        return N
    elif N < 100:
        return 9
    elif N < 1000:
        return N-90
    elif N < 10000:
        return 909
    elif N < 100000:
        return N - 9090
    else:
        return 90909


if __name__ == "__main__":
    N = int(input())

    ans = uneven_numbers(N)
    print(ans)

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

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

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

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

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

print(sum)

Solution (Python):
N = int(input())
a = list(range(1, 10)) + list(range(100, 1000)) + list(range(10000, 100000))
for index, value in enumerate(a):
  if value > N:
    print(index)
    exit()

print(len(a))

Solution (Python):
N = int(input())
def f(i):
    for j in range(1, 7):
        if 10**j > i:
            return j
ans = 0
for i in range(1, N+1):
    if f(i) % 2 != 0:
        ans += 1

print(ans)

Solution (Python):
n = int(input())
def numOfDigits(num):
    return len(str(num))
ans = 0
while n > 0:
    if numOfDigits(n)%2 == 1:
        ans += 1
    n -= 1
print(ans)

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

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

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

print(count)

Solution (Python):
N = int(input())
digit = len(str(N))
one = 9
three = 900
five = 90000

if digit == 6:
    print(str(five+three+one))
elif digit == 5:
    print(str(three+one+(N-9999)))
elif digit == 4:
    print(str(three+one))
elif digit == 3:
    print(str(one+N-99))
elif digit == 2:
    print(str(one))
else:
    print(str(N))

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

for i in range(1, n + 1):
    if i < 10:
        count += 1
    elif i >= 10 ** 2 and i < 10 ** 3:
        count += 1
    elif i >= 10 ** 4 and i < 10 ** 5:
        count += 1
print(count)

Solution (Python):
from sys import stdin

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

    ans = 0
    for i in range(1, N + 1):
        if any((1 <= i <= 9,
                100 <= i <= 999,
                10000 <= i <= 99999)):
            ans += 1
    print(ans)

input = lambda: stdin.readline()
main()

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

Solution (Python):
import math
N=int(input())
L=math.log10(N)

if L<1.:
    print(N)
elif 1.<= L < 2.:
    print(9)
elif 2.<= L < 3.:
    print(N-100+1+9)
elif 3.<= L < 4.:
    print(909)
elif 4.<= L < 5.:
    print(N-10000+1+909)
elif L==5.:
    print(90909)

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

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

Solution (Python):
N = int(input())
ans = 0
for i in range(N):
    if ( 0 < i+1  and i +1 <10 ) :
        ans = ans +1
    elif ( 99 < i+1  and i +1 <1000 ) :
        ans = ans +1
    elif (  9999 <i+1 and i + 1  <100000 ) :
        ans = ans +1
print(ans)

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

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

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

print(count)

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

Solution (Python):
N = int(input())
l = len(str(N))
ans = 0

if l != 1:
    if l%2 == 0:
        for i in range(0, l, 2):
            ans += 9*(10**i)
    else:
        for i in range(0,l-2, 2):
            ans += 9*(10**i)
            
        ans += N - int('9'*(len(str(N))-1))
else:
    ans = N

print(ans)

Solution (Python):



def main():
    n = int(input().strip())
    if n >= 100000:
        r = (99999 - 10000 + 1) + (999 - 100 + 1) + (9 - 1 + 1)
    elif n >= 10000:
        r = (n - 10000 + 1) + (999 - 100 + 1) + (9 - 1 + 1)
    elif n >= 1000:
        r = (999 - 100 + 1) + (9 - 1 + 1)
    elif n >= 100:
        r = (n - 100 + 1) + (9 - 1 + 1)
    elif n >= 10:
        r = (9 - 1 + 1)
    else:
        r = n - 1 + 1
    print('%d' % r)


if __name__ == '__main__':
    main()

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

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(9+900+n-9999)

elif n==100000:
        print(9+900+n-9999-1)

Solution (Python):
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)
elif keta == 6:
    print(90909)

Solution (Python):

n = int(input())

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

print(cnt)

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