Problem:
 Score: 200 points    Problem Statement  The number 105 is quite special - it is odd but still it has eight divisors.
Now, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?      Constraints   N is an integer between 1 and 200 (inclusive).         Input  Input is given from Standard Input in the following format:  N       Output  Print the count.        Sample Input 1 105      Sample Output 1 1  Among the numbers between 1 and 105 , the only number that is odd and has exactly eight divisors is 105 .       Sample Input 2 7      Sample Output 2 0  1 has one divisor. 3 , 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.

Solution (Python):
n = int(input())
if n <= 104:
    ans = 0
elif n >= 105 and n < 135:
    ans = 1
elif n >= 135 and n < 165:
    ans = 2
elif n >= 165 and n < 189:
    ans = 3
elif n >= 189 and n < 195:
    ans = 4
elif n >= 195:
    ans = 5
print(ans)

Solution (Python):
import math

N = int(input())

def make_prime_list(num):
    if num < 2:
        return []

    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def search_divisor_num(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num


print(int(list(map(search_divisor_num,list(range(1,N + 1))[:: 2])).count(8)))

Solution (Python):
N=int(input())
if N<105:
    print(0)
elif N<135:
    print(1)
elif N<165:
    print(2)
elif N<189:
    print(3)
elif N<195:
    print(4)
else:
    print(5)

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

ans = 0
for i in range(1, N + 1, 2):
    num = 0
    for d in range(1, i + 1):
        if i % d == 0:
            num += 1
    if num == 8:
        ans += 1

print(ans)

Solution (Python):



n = int(input())

ans = 0
for n in range(n+1):
    if len([i for i in range(1,n+1) if n%i==0 and i%2!=0]) >= 8:
        ans+=1

print(ans)

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

if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n < 189:
    print(3)
elif n < 195:
    print(4)
else:
    print(5)

Solution (Python):
N, = list(map(int,input().split()))

ans = 0

for i in range(N+1):
    if  i % 2 == 1:
        num = 0
        for j in range(1,201):
            if  i % j == 0:
                num += 1
                if  num == 8:
                    ans += 1
        
print(ans)

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

def isYakusuEight(a):
    if a % 2 == 0:
        return False
    cnt = 0
    for i in range(1, a+1):
        if a % i == 0:
            cnt += 1
    return cnt == 8

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

Solution (Python):
A=int(input())
count=0
for i in range(int((A+1)/2)):
    B=i*2+1
    div=[]
    for j in range(1,B):
        if B%j==0:
            div.append(j)
        else:
            pass
    else:
        div.append(B)
    if len(div)==8:
        count+=1
    else:
        pass
else:
    print(count)

Solution (Python):

n = int(input())

if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n < 189:
    print(3)
elif n < 195:
    print(4)
else:
    print(5)

Solution (Python):
N = int(input())
count = 0
for j in range(N+1):
  sum = 0
  for i in range(1,200,2):
    if j%i == 0:
      sum = sum+1
  if sum == 8:
    count = count+1
print(count)

Solution (Python):
A = int(input())
import numpy as np
L = np.arange(1,A+1,2)
count = 0 
countA = 0
for i in L:
    count=0
    for t in range(i):
        count+=1 if i%t==0 else 0
    countA += 1 if count == 8 else 0
print(countA)

Solution (Python):
n=input()
print sum(1 for k in range(1,n+1,2) if sum(1 for v in range(1,k+1) if k%v==0)==8)

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

c = 0
for n in range(1, N+1, 2):
  d = 0
  for i in range(1, n+1):
    if i * i > n:
      break
    if n % i == 0:
      d += 2
      if d >= 9:
        break
  if d == 8:
    c += 1

print(c)

Solution (Python):
n = int(input())
lst = [105, 135, 165, 189, 195, 201]
for i in range(6):
    if n < lst[i]:
        print(i)
        break

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

list = [105,135,165,189,195]
ans = 0
for i in list:
    if i<=N:
        ans += 1
print(ans)

Solution (Python):
N = int(input())
ret = 0
for x in range(1, N + 1, 2):
    count = 0;
    for y in range(1,  x + 1):
        count += 1 if (x % y) == 0 else 0
    if (count == 8):
        ret += 1
print(ret)

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

if n >= 195:
    print(5)
elif n >= 189:
    print(4)
elif n >= 165:
    print(3)
elif n >= 135:
    print(2)
elif n >= 105:
    print(1)
else:
    print(0)

Solution (Python):
n = int(input())
if n < 105:
    print(0)
elif 105 <= n < 135:
    print(1)
elif 135 <= n < 165:
    print(2)
elif 165 <= n < 189:
    print(3)
elif 189 <= n < 195:
    print(4)
elif 195 <= n:
    print(5)

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

if a>=3*5*13:
    print(5)
elif a>=27*7:
    print(4)
elif a>=3*5*11:
    print(3)
elif a>=135:
    print(2)
elif a>=105:
    print(1)
else:
    print(0)

Solution (Python):
N = int(input())
def get(n, item):
    i = 0
    while n%item==0:
        n = n/item
        i += 1
    return i
def get2(n):
    l = []
    target = [3,5,7,11,13]
    for item in target:
        l.append(get(n,item))
        if not l: continue
    m = 1
    for item in l:
        m *= (item+1)
    if m == 8:
        return 1
    else:
        return 0

out = 0
for n in range(105, N+1, 2):
    tmp = get2(n)
    out += tmp

print(out)

Solution (Python):
l = input().split()
A = int(l[0])

ans = 0
if A > 105 - 1:
    ans = ans + 1

if A > 135 - 1:
    ans = ans + 1

if A > 165 - 1:
    ans = ans + 1

if A > 189 - 1:
    ans = ans + 1

if A > 195 - 1:
    ans = ans + 1


print(ans)

Solution (Python):
N = int(input())
if (N&1)==0: ans = 0
if   N<3*5* 7: ans = 0
elif N<3*5* 9: ans = 1
elif N<3*5*11: ans = 2
elif N<3*7* 9: ans = 3
elif N<3*5*13: ans = 4
else:          ans = 5
print(ans)

Solution (Python):
n=int(input())
if n<105:
    print(0)
elif n<135:
    print(1)
elif n<165:
    print(2)
elif n<189:
    print(3)
elif n<195:
    print(4)
else:
    print(5)

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

if (n<105) :
   print(0)
elif (n<135) :
   print(1)
elif (n<165) :
   print(2)
elif (n<189) :
   print(3)
elif (n<195) :
   print(4)
else :
   print(5)

Solution (Python):
def make_divisor(n):
    table = [0] * (n + 1)
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    return table

n = int(input())
t = make_divisor(n)
print(len([1 for i in range(1, n + 1) if i & 1 and t[i] == 8]))

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

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





ans = 0
for j in range(1,N+1):
    count = 0
    if j % 2 == 0:
        continue
    for i in range(1,j+1):
        if (j % i) == 0:
            count += 1
    if count == 8:
        ans += 1

print(ans)

Solution (Python):
N=int(input())
t=0
for i in range(1,N+1,2):
    s=0
    for j in range(1,i+1,2):
        if i%j==0:
            s+=1
    if s==8:
        t+=1
print(t)

Solution (Python):


n = int(input())

def judge(x):
    ret = 1
    for i in range(1,x):
        if x%i==0:
            ret += 1
    return ret

ret = 0
for i in range(1,n+1):
    if i%2==1 and judge(i)==8:
        ret += 1
print(ret)

Solution (Python):
N = int(input())
anslist = [105, 165, 195, 135, 189]
print(len([i for i in anslist if i <= N]))

Solution (Python):



n = int(input())

count = 0
if n >= 105:
    count += 1
if n >= 135:
    count += 1
if n >= 165:
    count += 1
if n >= 189:
    count += 1
if n >= 195:
    count += 1
print(count)

Solution (Python):
N = int(input())
if N<=104:
    print(0)
elif N<=134:
    print(1)
elif N<=164:
    print(2)
elif N<=188:
    print(3)
elif N<=194:
    print(4)
else:
    print(5)

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

if(N<105):  print(0)
elif(N<135):  print(1)
elif(N<165):  print(2)
elif(N<189):  print(3)
elif(N<195):  print(4)
else:  print(5)

Solution (Python):




def solve():
    n = int(input())
    if n < 105:
        print(0)
        return

    ans = 0
    for i in range(105, n + 1, 2):
        t = 0
        for j in range(1, n + 1, 2):
            if i % j == 0:
                t += 1
        if t == 8:
            ans += 1
    print(ans)


if __name__ == "__main__":
    solve()

Solution (Python):
n = int(input())
ans = 0
for i in range(1, n + 1):
  yaku = 0
  for j in range(1, i + 1):
    if i % j == 0:
      yaku += 1
  if yaku == 8 and i % 2 == 1:
    ans += 1
print(ans)

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

def f(n):
    lists = []
    for i in range(1, n+1):
        if n % i == 0:
            lists.append(i)
    return len(lists)

count = 0
for j in range(1, N+1, 2):
    if f(j) == 8:
        count += 1
        
print(count)

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



def count_yakusuu(n):
    c = 0
    for j in range(1, n+1):
        if n % j == 0:
            
            c += 1
    return c


cnt = 0
for i in range(1,N+1,2):
    c = count_yakusuu(i)
    
    if count_yakusuu(i) == 8:
        
        cnt += 1

print(cnt)

Solution (Python):
N=int(input())
total=0
for i in range (1,N+1):
    count=0
    for j in range(1,i+1):
        if(i%j==0):
            count=count+1    
    if((count==8)&(i%2==1)):
        total=total+1
print(total)

Solution (Python):


N = int(input())

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

    if count == 8:
        
        
        ans += 1

print(ans)

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

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


ans=0
for j in range(1,N+1, 2):
	count=0
	for i in range(1, j+1):
		if (j/i)==(j//i):
			count+=1
	else:
		if(count==8): 
			ans+=1


print(ans)

Solution (Python):
from collections import defaultdict
import math
n = int(input())

def primelist(num):
    if num < 2:
        return []

    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def prime_factorization(num):
    if num <= 1:
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = primelist(num_sqrt)

        dict_counter = defaultdict(int)
        for prime in prime_list:
            while num % prime == 0:
                dict_counter[prime] += 1
                num //= prime
        if num != 1:
            dict_counter[num] += 1

        dict_counter = dict(dict_counter)

        return dict_counter

def search_divisor_num(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        divisor_num = 1
        dict_fact = prime_factorization(num)
        for value in dict_fact.values():
            divisor_num *= (value + 1)
        return divisor_num

cnt = 0
for i in range(1, n+1):
    if i%2 != 0:
        if search_divisor_num(i) == 8:
            cnt+=1
print(cnt)

exit(0)

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

for i in range(1,N+1):
    if (i%2 != 0):
        cnt = 0
        for j in range(1,i+1):
            if (i%j == 0):
                cnt+=1
        if (cnt == 8):
            ans+=1
print(ans)

Solution (Python):

import math,string,itertools,fractions,heapq,collections,re,array,bisect


N = int(input())
ans = 0
if N < 105:
    print(0)
    exit()

num = N

ans = 0
for n in range(105,N+1):
    yakusuu_array = []
    if n % 2 == 1:
        for i in range(1,n):
            if n % i == 0:
                yakusuu_array.append(i)
        if len(yakusuu_array)+1 == 8:
            ans += 1
print(ans)

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

Solution (Python):
N = int(input())
total_number = 0
n = 0
while 2*n+1 <=N:
    yakusuu = 1
    yakusuu_number = 0
    while yakusuu <=2*n+1:
        if (2*n+1) % yakusuu ==0:
            yakusuu_number += 1
        yakusuu += 1
    n += 1
    if yakusuu_number == 8:
        total_number += 1
print(total_number)

Solution (Python):
a=int(input())
if a < 105:
    print("0")
else:
    count=1
    for i in range(107, a+1, 2):
        now=i
        count8=0
        for j in range(1, 200):
            if now % j == 0:
                count8+=1
        if count8==8:
            count+=1
    print(count)

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

for i in range(1,N+1,2):
	j = 0
	yakusuu = 0

	while(j<=i):
		j += 1
		if(i%j==0):

			yakusuu += 1

	if(yakusuu==8):
		count += 1
print(count)

Solution (Python):
def numOfYaku(arg):
    ret = 0
    for i in range(1, arg + 1):
        if arg % i == 0:
            ret += 1
    return ret

a = int(input())
ans = 0
for j in range(1, a + 1):
    if numOfYaku(j) == 8 and j % 2 ==1 : ans += 1
print(ans)

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

for i in range(1,N+1,2):
    for j in range(1,int((i-1)/2)):
        if i%j == 0:
            c += 1
    if c == 8:
        count += 1
    c = 1
print(count)

Solution (Python):
import math

n = int(input())

if n < 105:
    ans = 0
else:
    ans = 0
    for i in range(105,n+1,2):
        cnt = 0
        for j in range(1,int(math.sqrt(i))+1):
            if i % j == 0:
                
                cnt += 2
        if cnt == 8:
            ans += 1
            

print(ans)

Solution (Python):
import math, string, fractions, heapq, re, array, bisect, sys, random, time, copy
import itertools as it
import operator as op
import collections as cl
import functools as ft

def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x) - 1, input().split()))
def LF(): return list(map(float, input().split()))
def LS(): return input().split()
def I(): return int(input())
def F(): return float(input())
def S(): return input()


def factorize(n):
    fct = []  
    b, e = 2, 0  
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def count_divisor(fct):
    counts_plus1 = [count+1 for _, count in fct]
    total = ft.reduce(op.mul, counts_plus1)

    return total


if __name__ == '__main__':
    n = I()
    count_8 = 0
    for i in range(3, n+1, 2):
        fct = factorize(i)
        if count_divisor(fct) == 8:
            count_8 += 1

    print(count_8)

Solution (Python):


n = int(input())
ans = 0

if n >= 105: 
    ans+=1
if n >= 135: 
    ans+=1
if n >= 165: 
    ans+=1
if n >= 189: 
    ans+=1
if n >= 195: 
    ans+=1
print(ans)

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

answer=0
if A<=104:
  print(0)
  exit()
else:
  for i in range(105,A+1,2):
    count=0
    for j in range(1,i+1):
      if i%j==0:
        count+=1
    if count==8:
      answer+=1
print(answer)

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

count = 0
ans  = 0

for i in [x for x in range(n+1) if x % 2 != 0]:
    
    count = 0
    for j in range(n):
        if i % (j+1) == 0:
            
            count += 1
    
    if count == 8:
        ans += 1
print(ans)

Solution (Python):

import logging
import time


class Solver:
    def __init__(self):
        self.n = 0

    
    def input_value(self):
        
        
        
        
        
        self.n = int(input())

    @staticmethod
    def calc_count(m):
        result = 1
        if m % 2 == 0:
            return 0
        for i in range(3, m + 1):
            if m % i == 0:
                result += 1
        return result

    @staticmethod
    def run(n):
        count = 0
        for i in range(1, n + 1, 2):
            if Solver.calc_count(i) == 8:
                count += 1
                
        return count

    @staticmethod
    def test():
        start_time = time.time()

        assert Solver.calc_count(105) == 8, 'Error.'

        elapsed_time = time.time() - start_time
        logging.debug('elapsed_time: {0}'.format(elapsed_time) + '[sec]')


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    solver = Solver()
    

    solver.input_value()
    ans = solver.run(solver.n)
    print(str(ans))

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

res = 0
for i in range(1,N+1,2):
    cnt = 0
    for j in range(1,N+1):
        if i%j==0:
            cnt += 1
    if cnt == 8:
        res += 1
print(res)

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

num = 0
for i in range(1, N+1):
    divisors = {}
    if i % 2 == 0:
        continue
    for j in range(3, i+1):
        if j % 2 == 0:
            continue
        if i % j == 0:
            if j in divisors.keys():
                divisors[j] += 1
            else:
                divisors[j] = 1
    if sum(divisors.values()) + 1 == 8:
        num += 1

print(num)

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

y = 0
ans = 0
for i in range(1, n + 1):
    if i % 2 == 0:
        continue
    for j in range(1, i + 1):
        if i % j == 0:
            y += 1
    if y == 8:
        ans += 1
    y = 0

print(ans)

Solution (Python):
def f(n):
    if n % 2 == 0:
        return False
    
    dic = {}
    res = 2
    for i in range(3, n//2 + 1):
        if n % i == 0:
            res += 1
    return res == 8

N = int(input())
if N < 105:
    print(0)
else:
    res = 0
    for n in range(105, N + 1):
        if(f(n)):
            res += 1
    print(res)

Solution (Python):
N = int(input())
ans = 0
for x in range(105, N+1, 2):
    cnt = 1
    for y in range(2, x+1):
        if x % y == 0:
            c = 0
            while x % y == 0:
                c += 1
                x //= y
            cnt *= c+1
    if cnt == 8:
        ans += 1
print(ans)

Solution (Python):
import math

n = int(input())

def make_prime_list(num):
  if num < 2:
        return []

  prime_list = [i for i in range(num + 1)]
  prime_list[1] = 0
  num_sqrt = math.sqrt(num)

  for prime in prime_list:
    if prime == 0:
      continue
    if prime > num_sqrt:
      break

    for non_prime in range(2 * prime, num, prime):
      prime_list[non_prime] = 0

  return [prime for prime in prime_list if prime != 0]

def search_divisor_num(num):
  if num < 0:
    return None
  elif num == 1:
    return 1
  else:
    num_sqrt = math.floor(math.sqrt(num))
    prime_list = make_prime_list(num_sqrt)

    divisor_num = 1
    for prime in prime_list:
      count = 1
      while num % prime == 0:
        num //= prime
        count += 1
      divisor_num *= count

    if num != 1:
      divisor_num *= 2

    return divisor_num

i = 1
result = 0

while i <= n:
  divisor_count = search_divisor_num(i)
  if divisor_count == 8:
    result += 1
  i += 2

print(result)

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

if n<105:
  print(0)
else:
  lst=[]
  
  for i in range(105,n+1):
    counter = 1
    if i % 2 == 1:
      for j in range(2, i+1):
        if i % j == 0:
          counter += 1
        if counter > 8:
          break
      if counter == 8:
        lst.append(i)
  print(len(lst))

Solution (Python):
N = int(input())
ans = 0
for i in range(N+1):
  yaku = 0
  if (i+1) % 2 == 1:
    continue
  for j in range(i):
    if i % (j+1) == 0:
      yaku += 1
  if yaku == 8:
    ans += 1 
print(ans)

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

ans = 0
for n in range(1, N+1):
    if n % 2 == 0:
        continue
    elif n < 105:
        continue
    count = 0
    for j in range(1, n+1):
        if n % j == 0:
            count += 1
            if count >= 9:
                break
    if count == 8:
        ans += 1

print(ans)

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

if N >= 195:
    print(5)
elif N >= 189:
    print(4)
elif N >= 165:
    print(3)
elif N >= 135:
    print(2)
elif N >= 105:
    print(1)
else:
    print(0)

Solution (Python):
n = int(input())
if(n < 105):
  print(0)
elif(n < 135):
  print(1)
elif(n < 165):
  print(2)
elif(n < 189):
  print(3)
elif(n < 195):
  print(4)
else:
  print(5)

Solution (Python):
B = raw_input()
A = int(B)

if A < 105:
  print 0
  
elif 104 < A < 135:
  print 1

elif 134 < A < 165:
  print 2

elif 164 < A < 189:
  print 3

elif 188 < A < 195:
  print 4
  
elif 194 < A:
  print 5

Solution (Python):
n = int(input())
s = [105, 135, 165, 189, 195]

cnt = 0

for i in range(n + 1):
    if i in s:
        cnt += 1

print(cnt)

Solution (Python):
a=[3**3*5,3**3*7,3*5*7,3*5*11,3*5*13]
a.sort()
n= int(input())
for i in range(len(a)):
    if a[i]>n:break
    if i==4:i=5
print(i)

Solution (Python):
N = int(input())
if N < 105:
    print(0)
elif N < 135:
    print(1)
elif N < 165:
    print(2)
elif N < 189:
    print(3)
elif N < 195:
    print(4)
else:
    print(5)

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

num_ans = 0
for n in list(range(1,n_max+1,2)):
    n_ori = n
    yaku = []
    for k in range(3,100):
        if n%k == 0:
            n = n/k
            yaku.append(k)

    ans = 2**len(yaku)
    waru = [yaku.count(y) for y in yaku]
    for w in waru:
        ans/=w
    if ans == 8:
        num_ans += 1

print(num_ans)

Solution (Python):
a = int(input())
b = 0
for i in range(a):
    cnt = 0
    if (i+1)%2 != 0:
        for j in range(i+1):
            if (i+1)%(j+1) == 0:
                cnt +=1
        if cnt == 8:
            b +=1
print(b)

Solution (Python):
n = int(input())
if n < 105:
    print(0)
elif n < 135:
    print(1)
elif n < 165:
    print(2)
elif n < 189:
    print(3)
elif n < 195:
    print(4)
else:
    print(5)

Solution (Python):
n = int(input())
if(n<105):
    print("0")
elif(n<135):
    print("1")
elif(n<165):
    print("2")
elif(n<189):
    print("3")
elif(n<195):
    print("4")
else:
    print("5")

Solution (Python):
def sieve(n):
    """
    Sieve of Eratosthenes
    """
    s = [True for _ in range(n + 1)]
    for i in range(2, int(n ** 0.5) + 1):
        if s[i]:
            for j in range(i * 2, len(s), i):
                s[j] = False
    return (i for i in range(n + 1) if s[i] and i > 1)


def main():
    n = int(input())
    primes = sieve(n)
    c = 0
    for i in range(1, n + 1, 2):
        if i in primes:
            continue
        cp = 0
        for j in range(1, i + 1):
            if i % j == 0:
                cp += 1
        if cp == 8:
            c += 1
    print(c)


if __name__ == '__main__':
    main()

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

A = 1
res = 0
count = 0


while(1):
  for a in range(A):
    if A % (a+1) == 0:
      count+=1
      
  if count == 8:
    res+=1
  count = 0
  A+=2
  if A > N:
    break

print(res)

Solution (Python):
n = int(input())
count = 0
for i in range(1, n+1):
    div_count = 0
    for j in range(1, i+1):
        if i % j == 0 and j % 2 == 1:
            div_count += 1
    if div_count == 8:
        count += 1

print(count)

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

if N < 105:
    print(0)
elif N < 135:
    print(1)
elif N < 165:
    print(2)
elif N < 189:
    print(3)
elif N < 195:
    print(4)
else:
    print(5)

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())

count = 0
if N < 105:
    pass
else:
    for i in range(105, N+1):
        if i % 2 == 0:
            pass
        else:
            divisor = 0
            for j in range(1, i+1):
                if i % j == 0:
                    divisor += 1
            if divisor == 8:
                count += 1
print(count)

Solution (Python):
a = int(input())
v = [105, 135, 165, 189, 195]
frag = 1
for i in range(5):
    if v[i] > a:
        print(i)
        frag = 0
        break
if frag == 1:
    print(5)

Solution (Python):
def run(n):
    if n < 105:
        return 0
    elif n < 135:
        return 1
    elif n < 165:
        return 2
    elif n < 189:
        return 3
    elif n < 195:
        return 4
    else:
        return 5


def read_line():
    n = int(input())
    return n


def main():
    n = read_line()
    print(run(n))


if __name__ == '__main__':
    main()

Solution (Python):
def yakusu_count_is_8(n):
    count = 0
    for i in range(1, n+1):
        if n % i == 0:
            count += 1
    if count == 8:
        return True
    else:
        return False

N = int(input())

count = 0
for i in range(1, N+1, 2):
    if yakusu_count_is_8(i):
        count += 1
print(count)

Solution (Python):
N=int(input())
res = 0
for k in range(1,N+1):
    c = 0
    for i in range(1,k+1):
        if k%i == 0:
            c += 1
        else:
            pass
    if k%2 == 1 and c == 8:
        res += 1
    else:
        pass
print(res)

Solution (Python):
import numpy as np

N = int(input())

if N < 105:
    print(0)
elif N == 105:
    print(1)
else:
    num = np.array([i for i in range(105, N+1, 2)])
    count = np.zeros(len(num))

    for i in range(1, N+1):
        mask = num % i == 0
        count += mask

    print(list(count).count(8))

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


def N_checker(num):
    return 1 if N >= num else 0

res = 0
for i in [105, 135, 165, 189, 195]:
    res += N_checker(i)

print(res)

Solution (Python):
N = int(input())
if N < 105:
    print(0)
elif N < 135:
    print(1)
elif N < 165:
    print(2)
elif N < 189:
    print(3)
elif N < 195:
    print(4)
else:
    print(5)

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

if N < 105:
    print(0)
elif N<135:
    print(1)
elif N<165:
    print(2)
elif N<189:
    print(3)
elif N<195:
    print(4)
else:
    print(5)

Solution (Python):
a=[105,135,165,189,195]
N=int(input())
ans=0
for i in range(N+1):
    ans += int(i in a)
print(ans)

Solution (Python):

N=int(input())
a=[105,135,165,189,195]
s=0
for i in a:
    if i<=N:
        s+=1
    else:
        break
print(s)

Solution (Python):
n=int(input())
b=[3*5*7, 3*5*9, 3*5*11, 27*7, 3*5*13]
a=0
for i in range(len(b)):
    if b[i]<=n:
        a+=1
print(a)

Solution (Python):

N=int(input())
a=[105,135,165,189,195]
s=0
for i in a:
    if i<=N:
        s+=1
    else:
        break
print(s)

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

if a >= 195:
    print("5")
elif a >= 189:
    print("4")
elif a >= 165:
    print("3")
elif a >= 135:
    print("2")
elif a >= 105:
    print("1")
else:
    print("0")

Solution (Python):
n = int(input())
l = [105,165,195,135,189]
ans = 0
for i in l:
    if i <= n:
        ans+=1
print(ans)

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

a = 3*3*3*5
b = 3*3*3*7

m = 0

l = [3, 5, 7, 11, 13]

for f in range(5):
    for g in range(f+1, 5):
        for h in range(g+1, 5):
            if l[f]*l[g]*l[h] <= n:
                m += 1
        
if n>=a:
    m += 1
    if n>=b:
        m+= 1
        
print(m)

Solution (Python):
N = int(input())
ans = 0
if N <= 7:
	print(ans)
else:
	for i in range(8, N + 1):
		temp = 0
		for j in range(1, N + 1):
			if i % 2 == 1 and i % j == 0:
				temp += 1
		if temp == 8:
			ans += 1
	print(ans)

Solution (Python):
def cd(n):
	res=0
	for i in range(1,n+1):
		if n%i==0:
			res+=1
	return res
n=int(input())
ans=0
for i in range(1,n+1,2):
	if cd(i)==8:
		ans+=1
print(ans)

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

if(A<105):
    print(0);
elif(A<135):
    print(1);
elif(A<165):
    print(2);
elif(A<189):
    print(3);
elif(A<195):
    print(4);
else:
    print(5);

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

def calc_deviser(n):
    tmp=0
    for i in range (1,n+1):
        if n%i==0:
            tmp +=1
    return tmp



answer = 0
for i in range(1,N+1,2):
    if calc_deviser(i) == 8:
        answer += 1
print(answer)

Solution (Python):
import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

N=ni()

def yaku(num):
  i = 0
  for j in range(num//2):
    if num%(j+1) ==0:
      i+=1
  return i+1

if N<105:
  print(0)
elif N==105:
  print(1)
else:
  ans = 1
  for i in range(107,N+1,2):
    if yaku(i) == 8:
      ans+=1
  print(ans)

Solution (Python):
N = int(input())
odds = [o for o in range(N+1) if o % 2 == 1]

count = 0
for o in odds:
    yaku = []
    for r in [r for r in odds if r <= o]:
        if o % r == 0:
            yaku.append(1)
    
    if (len(yaku)) == 8:
        count += 1

print(count)

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

cnt = 0
for lop in range(1,data+1,2):
    buf = lop
    cnt2 = 0
    for lop2 in range(1,lop+1):
        if buf%lop2 == 0:
            cnt2 = cnt2 +1
        elif buf == 1:
            break
    if cnt2 == 8:
        cnt = cnt + 1
            
print(cnt)

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


if a <= 104:
    print(0)
elif a >= 105 and a< 135:
    print(1)

elif a>= 135 and a< 165:
    print(2)
elif a>= 165 and a< 189:
    print(3)
elif a>= 189 and a < 195:
    print(4)
elif a<= 200:
    print(5)

Solution (Python):
n=int(input())
p=0
def f(n):
    a=0
    for i in range(2,n):
        if n%i==0:
            a+=1
    if a==6 and n%2==1:
        return True
    else:
        return False
        
if n<105:
    print(0)
else:
    for i in range(105,n+1):
        if f(i)==True:
            p+=1
    print(p)

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

for i in range(1,n+1):
    if i % 2 == 1:
        co = 0
        for j in range(1,i+1):
            if i % j == 0:
                co += 1
        else:
            if co == 8:
                res += 1
else:
    print(res)

Solution (Python):
import sys

def f(n):
    r = []
    for d in range(1, n+1, 2):
        if n % d == 0:
            r.append(d)
    return r

def main(N):
    count = 0
    for i in range(1, N+1, 2):
        r = f(i)
        print(i, r, len(r), file=sys.stderr)
        if len(r) == 8:
            count+=1

    return count

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

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


for i in range(1,N+1,2):
    divisor = 1
    for j in range(1, i//2 +1):
        if i % j == 0:
            divisor += 1
        if divisor > 8:
            break
    else:
        if divisor == 8:
            ans += 1

print(ans)

Solution (Python):
N=input()

ans=0

for x in range(1,N+1,2):
	cnt=0
	for i in range(1,x+1):
		if x%i==0:
			cnt+=1
	else:
		if cnt==8:
			ans+=1

print ans

Solution (Python):
from math import sqrt, floor
A = int(input())
if A < 105:
  print("0")
  exit(0)

Q = 105
ans = 0

while Q <= A and Q <= 200: 
  cnt = 0
  i = 1
  while i <= sqrt(Q):
    if Q % i == 0:
      cnt += 1
    i += 2
    
  
  if cnt == 4:
    ans += 1
  Q += 2

print(ans)

Solution (Python):
n = int(input())
ps = [3, 5, 7, 11, 13]

ans = 0
for i in range(1, n + 1, 2):
    t = 1
    x = i
    for p in ps:
        cnt = 0
        while x % p == 0:
            x //= p
            cnt += 1
        t *= cnt + 1
    if t == 8:
        ans += 1
print(ans)