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 count(n):
    
    if n < 1:
        return 0
    
    
    keta = len(str(n))-1
    if keta % 2 == 1:
        ans = 0
        n = 10**keta-1
    else:
        ans = n - 10**keta + 1
        n = 10**(keta-1)-1
    return ans + count(n)


n = int(input())
print(count(n))

Solution (Python):
n=int(input())
cnt=0
x=0
 
for i in range(0,5,2):
    if n>=10**(i+1):
        cnt+=9*(10**i)
    else:
        if n>=10**(i):
            cnt+=n-(10**i)+1
        else:
            x+=1
    
print(cnt)

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

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

for i in reversed(range(1, n+1)):
    if i // 10 == 0:
        count += 1
    elif i // (10 ** 2) >= 1 and i // (10 ** 2) <= 9:
        count += 1
    elif i // (10 ** 4) >= 1 and i // (10 ** 4) <= 9:
        count += 1

print(count)

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

ans = 0

for x in range(1, N + 1):
	if len(str(x)) & 1:
		ans += 1

print(ans)

Solution (Python):
n = int(input())
ans = 0
i = 0
while 10**i <= n :
    if i % 2 == 1:
        ans += 9*10**(i-1)
    i += 1
if i % 2 == 1:
    ans += n-10**(i-1) + 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):
import math
n = int(input())
ans = 0
for i in range(1, n+1):
  if math.floor(math.log10(i)) % 2 == 0:
    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())
if n<10:
  print(n)
if 9<n<100:
  print(9)
if 99<n<1000:
  print(n-90)
if 999<n<10000:
  print(909)
if 9999<n<100000:
  print(n-9090)
if n==100000:
  print(90909)

Solution (Python):
n = int(input())
'''
s = str(n)
o = s.count('1','3','5','7','9')
e = s.count('0','2','4','6','8')
print(o)
'''
ans = 0
for i in range(1, n+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 = int(input())
n=N
c=0
while n>0:
  n//=10
  c+=1

if c%2==0:
  print(int((10**c-1)/11))
else: 
  print(int(N-10**(c-1)+1+(10**(c-1)-1)/11))

Solution (Python):
def main(n):
    count = 0

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

    print(count)


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

    main(n)

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

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

print(count)

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

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

Solution (Python):
n = input()
a = 0
b = 2
if len(n) % 2 == 0:
  for x in range(len(n)//2):
    a += 9 * (10 ** (b - 2))
    b += 2
    
  print(a)

elif len(n) % 2 != 0:
  if len(n) == 1:
    print(n)
  else:
    for x in range(len(n)//2):
     a += 9 * (10 ** (b - 2))
     b += 2
    print(int(n) - 10**(len(n)-1) + a + 1)

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

cnt = 0

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

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

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

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

Solution (Python):
import math
n=int(input())
ans=0
for i in range(1,n+1,1):
  if (int(math.log10(i))+1)%2==1:
    ans+=1
print(ans)

Solution (Python):
n = input()
output = 0
for i, _ in enumerate(n[::-1]):
    
    
    if i % 2 == 0:
        if i < len(n) - 1:
            output += 10 ** (i + 1) - 10 ** i
        else:
            output += int(n) - 10 ** i + 1

print(output)

Solution (Python):
n = input()
l = len(n)
res = 0
for i in range(l):
    if i == 0 or i == 2 or i == 4:
        if l - i == 1:
            res += int(n)-10**i+1
        else:
            res += 10**(i+1) - 10**i
print(res)

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

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

Solution (Python):
N = input()
if int(N) == 10**5:
    print(90909)
if len(N) == 5:
    print(int(N) - 9090)
if len(N) == 4:
    print(909)
if len(N) == 3:
    print(int(N) - 90)
if len(N) == 2:
    print(9)
if len(N) == 1:
    print(int(N))

Solution (Python):
n=int(input())
length=len(str(n))

count=0
for exp in range(0,length-1,2):
    count+=9*10**exp

if (length-1)%2==0 :
    count+=n-10**(length-1)+1

print(count)

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

import math
ans = 0
for i in range(1, N+1, 1):
    order = int(math.log10(i))+1
    if order%2 == 1:
        ans += 1
    else:
        continue

print(ans)

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


res=0
for i in range(N):
        j=i+1
        if j < 10:
                res+=1
        elif j >= 100 and j < 1000:
                res+=1
        elif j >= 10000 and j < 100000:
                res+=1

print(res)

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

if n >= 10 and n <= 99:
    print(9)
elif n >= 1000 and n <= 9999:
    print(909)
elif n == 100000:
    print(90909)
elif n < 10:
    print(n)
elif n >= 100 and n <= 999:
    print(9 + n - 99)
elif n >= 10000 and n <= 99999:
    print(909 + n - 9999)

Solution (Python):



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

Solution (Python):
cnt = 0
n = int(input())
if n>=10:
    cnt += 9
    if n>=1000:
        cnt += 900
        if n>=100000:
            cnt += 90000
        elif n>=10000:
            cnt += n-9999
    elif n>=100:
        cnt += n-99
else:
    cnt += n
print(cnt)

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):

n = int(input())
if n <= 9 :
    print(n)
elif n <= 99:
    print(9)
elif n <= 999:
    print(9 - 99 + n)
elif n <= 9999:
    print(9 - 99 + 999)
elif n <= 99999:
    print(9 - 99 + 999 - 9999 + n )
else:
    print(9 - 99 + 999 - 9999 + 99999)

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

if N ==100000:
    ans=90909
elif N > 9999:  
    ans=N-9999 +909
elif N > 999:
    ans=909
elif N > 99:
    ans=N-99 +9
elif N > 9:
    ans= 9
else :
    ans=N
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-100+1)
elif 1000<=N<=9999:
    print(909)
elif 10000<=N<=99999:
    print(909+N-10000+1)
else:
    print(909+90000)

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

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=input()
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())
if n < 10:
  print(n)
  exit()
if n >= 10 and n < 100:
  print(9)
  exit()
if n >= 100 and n < 1000:
  
  print(9 + (n-100) + 1)
  exit()
if n >= 1000 and n < 10000:
  print(909)
  exit()
if n >= 10000 and n < 100000:
  print(909 + (n-10000) + 1)
  exit
if n == 100000:
  print(90909)

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

l = range(1, n+1)
a = [i for i in l if i < 10]
a += [i for i in l if 100 <= i < 1000]
a += [i for i in l if 10000 <= i < 100000]

ans = len(a)
print(ans)

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())
a = [i for i in range(1,10)]
b = [i for i in range(100,1000)]
c = [i for i in range(10000,100000)]
U1 = a+b+c
U2 =[i for i in range(1,N+1)]
print(len(set(U1) & set(U2)))

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

i = 1
count = 0

while i <= N:
    if len(list(str(i))) % 2 != 0:
        count += 1
    i += 1

print(count)

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())

answer = sum(len(str(x))&1 for x in range(1,N+1))
print(answer)

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

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

Solution (Python):
N = int(input())
n = len(str(N))
 
if n==1:
	print(N)
else:
	M = [9,0]*(n//2)			
	M.pop()						
	M = map(str,M)				
	M = int(''.join(M))			
	if n%2==0:
		print(M)
	else:
		M = M + N - 10**(n-1) + 1
		print(M)

Solution (Python):
N = int(input())
n = len(str(N))
if n == 1:
    print(N)
else:
    M = [9,0] * (n//2)
    M.pop()
    M = map(str,M)
    M = int(''.join(M))
    if n % 2 == 0:
        print(M)
    else:
        M = M+N-10**(n-1)+1
        print(M)

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

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

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

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

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

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

Solution (Python):
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+900)
elif len(str(n)) == 5:
  print(909+(n-10000+1))
elif len(str(n)) == 6:
  print(90909)

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

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

def main():
    N = int(input())
    i = 1
    ans = 0
    while 10**i <= N:
        ans += ((10**i) - (10**(i-1)))
        i += 2
    ans += max(0, N-10**(i-1)+1)
    print(ans)


if __name__ == "__main__":
    main()

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

length = len(str(n))

if length == 1:
    res = n
elif length == 2:
    res = 9
elif length == 3:
    res = 9 + n - 99
elif length == 4:
    res = 909

elif length == 5:
    res = 9 + 900 + n - 9999
else:
    res = 90909

print(res)

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())
k2 = 9
k4 = len(range(100,1000))
k6 = len(range(10000,100000))
if len(str(n)) == 1:
  print(len(range(1,n+1)))
elif len(str(n)) == 2:
  print(k2)
elif len(str(n)) == 3:
  print(k2+len(range(100,n+1)))
elif len(str(n)) ==4:
  print(k2+k4)
elif len(str(n)) ==5:
  print(k2+k4+len(range(10000,n+1)))
elif len(str(n)) ==6:
  print(k2+k4+k6)

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

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

if l % 2 == 1:
    ans += n - 10 ** (l-1) + 1

print(ans)

Solution (Python):
def solve():
    n = int(input())
    if 0 < n <= 9:
        print(n)
    elif 9 < n <= 99:
        print(9)
    elif 99 < n <= 999:
        print(n-90)
    elif 999 < n <= 9999:
        print(999-90)
    elif 9999 < n <= 99999:
        print(n-9999+999-90)
    else:
        print(90909)

if __name__ == '__main__':
    solve()

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

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

print(ans)

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

ans = 0

for n in range(N):
    if len(str(n+1)) % 2 == 1:
        ans += 1
    else:
        pass

print(ans)

Solution (Python):
N = int(input())
ans = 0
for i in range(1,N+1):
  if len(str(i)) % 2 != 0:
    ans += 1
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())
ans=0
for i in range(1,n+1):
    if 0<i<10:
        ans+=1
    elif 9<i<100:
        ans+=0
    elif 99<i<1000:
        ans+=1
    elif 999<i<10000:
        ans+=0
    elif 9999<i<100000:
        ans+=1
    else:
        ans+=0
print(ans)

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

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

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

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

print(ans)

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

print(a)

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

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

for i in range(l)[::2]:
    ans += 9 * 10 ** i

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

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

print(digit_odd)

Solution (Python):
n = int(input())
if n < 10:
	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):
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 = 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())

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

print(ans)

Solution (Python):
n=int(input())
if n<10:
  print(n)
elif n<10**2:
  print(9)
elif n<10**3:
  print(n-(10**2-1)+9)
elif n<10**4:
  print(900+9)
elif n<10**5:
  print(n-(10**4-1)+900+9)
else:
  print(9*10**4+9*10**2+9)

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

tmp = N
for i in range(1,8):
    tmp /= 10
    if tmp < 1:
        N_digit = i
        break

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

if N_digit%2 == 1:
    ans += len(range(10**(N_digit-1), N+1))

print(ans)

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

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

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

print(oppai)

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


count=0
if d%2==1:
    count+=n-10**(d-1)+1
    for i in range((d-1)//2):
        count+=10**(2*i+1)-10**(2*i)
else:
    for i in range(d//2):
        count+=10**(2*i+1)-10**(2*i)
print(count)

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

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

Solution (Python):
N = int(input())
x, cnt = 0, 0
while 1:
    for i in range(100**x, 100**x*10):
        if(i > N):
            break
        else:
            cnt += 1
    if(i > N):
        break
    x += 1
print(cnt)

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

Solution (Python):
import math

N = int(input())

dig = len(str(N))

dig_odd = math.floor(dig / 2)

A = 0

for i in range(dig_odd):
  A += 9 * 10 ** (2 * i)

if dig % 2 == 1 and dig_odd >= 1:
  A += N - (10 ** (dig - 1) - 1)
elif dig == 1:
  A = N
  
print(A)

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

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

ans = 0

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

Solution (Python):
import sys
input=sys.stdin.readline
N=int(input())
ans=0
if N<=9:
  ans=N
elif 10<=N<=99:
  ans=9
elif 100<=N<=999:
  ans=9+(N-99)
elif 1000<=N<=9999:
  ans=909
elif 10000<=N<=99999:
  ans=909+(N-9999)
else:
  ans=90909
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in (1, 3, 5):
    if n / 10**i >= 1:
        ans += 10**i - 10**(i-1)
    elif n / 10**(i-1) >= 1:
        ans += n - 10**(i-1) + 1
print(ans)

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

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

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


def main():
    N = input()[:-1]
    
    cnt = 0
    for i in range(0, len(N), 2):
        if i==len(N)-1:
            cnt += int(N) - 10**i + 1
        else:
            cnt += 10**(i+1) - 10**i

    print(cnt)


if __name__ == '__main__':
    main()

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    cnt = 0
    for i in range(1, n + 1):
        t = str(i)
        cnt += 1 if len(t) % 2 != 0 else 0
    print(cnt)


if __name__ == '__main__':
    slove()

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

Solution (Python):
n=int(input())
if len(str(n))%2==0:
  print((10**len(str(n))-1)//11)
else:print(n-10**(len(str(n))-1)+1+((10**(len(str(n))-1)-1)//11)) if len(str(n))!=1 else print(n)

Solution (Python):
def main():

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

    return ans

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

Solution (Python):
n=input()
if len(n)==1:
  print(n)
elif len(n)==2:
  print(9)
elif len(n)==3:
  print(10+int(n)-100)
elif len(n)==4:
  print(909)
elif len(n)==5:
  print(909+int(n)-10000+1)
else:
  print(90909)

Solution (Python):
def func(n):
    c=0
    k=n
    while(n):
        n//=10
        c+=1
    if c%2==1:
        return True
    else:
        return False
N=int(input())
ans=0
for i in range(N):
    if func(i+1):
        ans+=1
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())

if N in range(1,10):
  print(N)
elif N in range(10, 100):
  print(9)
elif N in range(100, 1000):
  print(9+(N-100+1))
elif N in range(1000, 10000):
  print(9+900)
elif N in range(10000, 100000):
  print(9+900+(N-10000+1))
elif N == 100000:
  print(9+900+90000)

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

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

Solution (Python):

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

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

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

Solution (Python):
N = input()

ans = 0

while True:
    if len(N) == 6:
        N = str(99999)
    if len(N) == 5:
        ans += int(N) - 9999
        N = str(999)
    if len(N) == 4:
        N = str(999)
    if len(N) == 3:
        ans += int(N) - 99
        N = str(9)
    if len(N) == 2:
        N = str(9)
    if len(N) == 1:
        ans += int(N)
        break
    
print(ans)

Solution (Python):
n=input()
l=len(n)
a="090909"[:l]
print(a[1:] if l %2 ==0 else int(n)-int(a))

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())
ans = 0
if n < 10:
  print(n)
elif n < 100:
  print(9)
elif n < 1000:
  print(9 + n - 99)
elif n < 10000:
  print(9 + 900)
elif n < 100000:
  print(9 + 900 + n - 9999)
else:
  print(9 + 900 + 90000)

Solution (Python):


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

print(count)

Solution (Python):
import math
n=int(input())
k=int(math.log10(n)//1+1)

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

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

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

Solution (Python):

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

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

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

ans=0

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

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

print(ans)

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

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

cnt = 0
flag = True
for i in range(1, n + 1):
    if i == 10 or i ==100 or i==1000 or i==10000 or i ==100000or i==1000000:
        if flag:
            flag = False
        else:
            flag = True

    if flag:
        
        cnt += 1

print(cnt)

Solution (Python):
N =int(input())
if N >=10 and N<=99:
  print(9)
elif N >=100 and N<=999:
  print(N-90)
elif N >= 1000 and N<= 9999:
  print(9 + 900)
elif N >= 10000 and N<= 99999:
  print(N-90-9000)
elif N == 100000:
  print(9 + 900 + 90000)
else:
  print(N)

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

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

print(answer)

Solution (Python):
N = str(int(input()))
total = 0
digits = [i for i in range(len(N)) if i != 0 and i % 2 != 0]

if len(N) % 2 != 0:
    total += int(N) - int(str(1) + (len(N) - 1) * "0") + 1

for digit in digits:
    total += int("9" * digit) - int("1" + "0" * (digit - 1)) + 1

print(total)

Solution (Python):
N = str(int(input()))
i = 1
total = 0
digits = [i for i in range(len(N)) if i != 0 and i % 2 != 0]

if len(N) % 2 != 0:
    total += int(N) - int(str(1) + (len(N) - 1) * "0") + 1

for digit in digits:
    total += int("9" * digit) - int("1" + "0" * (digit - 1)) + 1

print(total)

Solution (Python):
N = input()
i = 1
total = 0
digits = [i for i in range(len(N)) if i != 0 and i % 2 != 0]

if len(N) % 2 != 0:
    total = int(N) - int(str(1) + (len(N)-1)*"0") + 1
    for digit in digits:
        total += int("9"*digit) - int("1"+"0"*(digit-1)) + 1
elif len(N) % 2 == 0:
    for digit in digits:
        total += int("9"*digit) - int("1"+"0"*(digit-1)) + 1

print(total)

Solution (Python):
N = input()
i = 1
total = 0
digits = [i for i in range(len(N)) if i != 0 and i % 2 != 0]

if len(N) % 2 != 0:
    total = int(N) - int(str(1) + (len(N)-1)*"0") + 1
    for digit in digits:
        total += int("9"*digit) - int("1"+"0"*(digit-1)) + 1
else:
    for digit in digits:
        total += int("9"*digit) - int("1"+"0"*(digit-1)) + 1

print(total)

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

    else:
        if n < 10 ** i:
            print(count)
            exit()

print(count)

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

for i in range(keta):
    if i % 2 == 1:
        continue
    if i+1 != keta:
        ans += len(range(10**i, (10**(i+1))-1)) + 1
    else:
        ans += len(range(10**i, N)) + 1

print(ans)

Solution (Python):









N = int(input())
o = len(str(N))
i = 1
sum = 0

if o % 2 == 0:
    while 2*i-1 <= o:
        sum += 9 * 100 ** (i-1)
        i += 1
else:
    sum += N
    while 2*i <= o:
        sum -= 90 * 100 ** (i-1)
        i += 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())
ans = 0
for i in range(1,N+1):
    if len(str(i)) %2 != 0:
        ans += 1
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())

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

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

Solution (Python):
N=int(input())
cnt=0
for x in range(1,N+1):
    if len(str(x))%2==1:
        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())
ans = 0

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

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

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

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

ans = 0

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

Solution (Python):
import math

def main():
    n, = map(int, open(0).read().split())

    digit = math.floor(math.log10(n)) + 1

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

if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]

N = int(input())

digit = len(str(N))

if digit == 1:
    ans = N
elif digit == 2:
    ans = 9
elif digit == 3:
    ans = N - 99 + 9
elif digit == 4:
    ans = 909
elif digit == 5:
    ans = N - 9999 + 900 + 9
elif digit == 6:
    ans = 90000 + 900 + 9

print(ans)

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

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 = list(input())
n = len(N)
N = int(''.join(N))

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