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):
import math
 
def make_prime_list_2(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_2(num):
    if num <= 1:
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)
 
        dict_counter = {}
        for prime in prime_list:
            while num % prime == 0:
                if prime in dict_counter:
                    dict_counter[prime] += 1
                else:
                    dict_counter[prime] = 1
                num //= prime
        if num != 1:
            if num in dict_counter:
                dict_counter[num] += 1
            else:
                dict_counter[num] = 1
 
        return dict_counter
 
def search_divisor_num_2(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        divisor_num = 1
        dict_fact = prime_factorization_2(num)
        for value in dict_fact.values():
            divisor_num *= (value + 1)
        return divisor_num
 
eight_list = []
for i in range(100):
    ii = i * 2 + 1
    if search_divisor_num_2(ii) == 8:
        eight_list.append(ii)
 
n = int(input())
use_list = [1 for i in eight_list if i <= n]
print(sum(use_list))

Solution (Python):
import math

def make_prime_list_2(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]

if __name__ == "__main__":
    N = int(input())
    if (N < 105):
        print(0)
    elif (N < 107):
        print(1)
    else:
        c = 1
        for j in range(107, N+1):
            num = j
            num_sqrt = math.floor(math.sqrt(num))
            prime_list = make_prime_list_2(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

            if divisor_num == 8 and j % 2 == 1:
                c = c + 1

            if j == N:
                print(c)

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

if N < 105:
  print(0)
else:
  print(len([i for i in range(105, N+1) if len([j for j in range(1, i+1, 2) if i%j == 0]) == 8]))

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

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

Solution (Python):
n = int(input())
count = 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:
            count = count + 1
    if count == 8 :
            ans = ans + 1
    count = 0

print(ans)

Solution (Python):
n = int(input())
rr = [0 for _ in range(n)]
rrr = 0

for i in range(n):
    for k in reversed(range(i + 1)):
        if (i + 1) % (k + 1) == 0:
            rr[i] += 1

    if (i + 1) % 2 != 0 and rr[i] == 8:
        rrr += 1

print(rrr)

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):
    if i % 2 ==0:
        continue
    count = 0
    for j in range(1,i+1):
        if i % j == 0:
            count = count + 1
    if count == 8:
        ans = ans + 1
print(ans)

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

Solution (Python):
a=int(input())
if a<105:print(0)
else:
    print(sum([1 for i in range(105,a+1,2) if len([I for I in range(1,a+1,2) if i%I==0])==8]))

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

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

Solution (Python):
x=int(input())
if(x<105):
    print ("0")
elif(x==105):
    print ("1")
else:
    f=1
    for j in range(107,x+1):
        if(j % 2 != 0):
            c=0
            for i in range(1, j + 1):
                if j % i == 0:
                    c=c+1
            if(c==8):
                f=f+1
    print(f)

Solution (Python):
n = int(input())
a = 0
if n >= 105:
    a += 1
if n >= 135:
    a += 1
if n >= 165:
    a += 1
if n >= 189:
    a += 1
if n >= 195:
    a += 1
print(a)

Solution (Python):
def fac(num):
    count = 0
    for i in range(1, num+1):
        if num % i == 0:
            count += 1
    return count
N = int(input())

C = 0
for i in range(1, N+1, 2):
    if fac(i) == 8:
        C += 1

print(C)

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

Solution (Python):
import math

n = int(input())

def devisors(z):
    r = 0
    for i in range(1, z + 1):
        if z % i == 0:
            r += 1
    return r 

r = 0

for i in range(1, n+1):
    if i % 2 == 1 and devisors(i) == 8:
        r += 1

print(r)

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):
N=int(input())
co=0
a=0
for j in range(1,N+1):
	if j%2==1:
		for i in range(1,j+1):
			if j%i==0:
				co=co+1
	if co==8:
		a=a+1
	co=0
print(a)

Solution (Python):
N=int(input())
r=0
for Q in range(1,N+1):
    k=0
    for i in range(1,Q+1):
        if Q%i==0:
            k=k+1
 
    if k==8:
        if Q%2==1:
            r=r+1
print(r)

Solution (Python):
N = int(input())
c=[3*5*7, 3*3*3*5, 3*5*11,  3*3*3*7, 3*5*13]
a=0
for num in c:
    if num <= N:
        a=a+1
print(a)

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

Solution (Python):

N = int(input())

if N < 105:
    ans = 0
else:
    ans = 1
    for i in range(107, N+2, 2):
        cnt = 0
        for j in range(1, N+1):
            if i % j == 0:
                cnt += 1

        if cnt == 8:
            ans += 1

print(ans)

Solution (Python):
def num_of_divisors(x):
  num=0
  for divisor in range(1, x + 1):
    if x % divisor == 0: num += 1
  return num

N = int(input())
cnt = 0
for i in range(1, N + 1, 2):
  if num_of_divisors(i) == 8:
    cnt += 1

print(str(cnt))

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

Solution (Python):

list=[0]*1000
for i in range(1,201,1):
    m=1
    while m*i<=200:
        list[m*i]+=1
        m+=1
n=int(input())
ct=0
for i in range(1,n+1,2):
    if list[i]==8:
        ct+=1
print(ct)

Solution (Python):
n= int(input())
ans =0
for i in range((n+1)//2):
	count=1
	for j in range(i//2):
		if (2*i+1)%(2*j+1)==0:
			count += 1
		
	if count == 8:
		ans +=1
	
print(ans)

Solution (Python):

list=[0]*1000
for i in range(1,201,1):
    m=1
    while m*i<=200:
        list[m*i]+=1
        m+=1
n=int(input())
ct=0
for i in range(1,n+1,2):
    if list[i]==8:
        ct+=1
print(ct)

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)
elif n < 201:
    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):
import numpy as np

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(e)
        b, e = b + 1, 0
    if n > 1:
        fct.append(1)
    return np.asarray(fct)

last_val = int(raw_input().replace("\n", ""))
count = 1 if last_val >= 105 else 0
for val in xrange(107, last_val+1, 2):
    ret = factorize(val)
    yaku_num = np.prod(ret + 1)
    if yaku_num == 8:
        count += 1

print count

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

print(ans)

Solution (Python):
print(sum([sum([i%j==0 for j in range(1,i+1)])==8 for i in range(1,int(input())+1,2)]))

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())
prime =[3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53]
count = 0
for i in range(N):
    if i+1 >= 105 and (i+1) % 2 == 1:
        tmp = 0
        for j in range(i+1):
            if (i+1) % (j+1) == 0:
                tmp += 1
        if tmp == 8:
            count += 1
print(count)

Solution (Python):

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

Solution (Python):
n=int(input())
res=0
for i in range(1,n+1,2):
    y=1
    for j in range(3,15):
        cnt=1
        while i%j==0:
            cnt+=1
            i//=j
        y*=cnt
    if y==8:
        res+=1
print(res)

Solution (Python):
N=int(raw_input())
d=0
for x in xrange(105,N+1):
    if(x%2==0): continue
    div=2
    i=2
    while i<=(x//2+x%2) and div<9:
        div=div+(0,1)[x%i==0]
        i=i+1
    
    if(div==8): d=d+1    
print("%d"%d)

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

Solution (Python):
N = int(input())+1
yakusuu = 0
for i in range(1,int((N-N%2)/2)+2):
    cnt = 0
    ii = 1+ 2*(i-2)
    for j in range(1,ii):
        if ii % j == 0:
            cnt = cnt+1
    cnt = cnt+1
    if cnt == 8:
        yakusuu = yakusuu + 1
print(yakusuu)

Solution (Python):
li = list(map(int,input().split()))
n=li[0]
ans = 0
for i in range(1,n+1):
    if i%2==0:
        continue
    count = 0
    for j in range(1,i+1):
        if i%j==0:
            count+=1
    if count == 8:
        
        ans+=1
print(ans)

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

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

result = 0
for i in range(1, n+1, 2):
    count = 0
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
    if count == 8:
        result += 1

print(result)

Solution (Python):
import math

n = int(input())

cnt = 0

def make_prime_list_2(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_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(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

for i in range(n+1):
    if i%2==1 and search_divisor_num_1(i) == 8:
        cnt += 1

print(cnt)

Solution (Python):
import numpy as np

def Count(n,divisor):
    print (divisor <= n).sum()

EightDivisors = np.array([3*5*7, 3*5*11, 3*5*13, 3*7*11, 3**3 *5, 3**3 * 7, 3**3 * 11])


n = int(raw_input())
Count(n, EightDivisors)

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):
prime = [3,5,7,11,13,17,19,23]
ans = []
for item1 in prime:
  for item2 in prime:
    for item3 in prime:
      if item1 != item2 and item2 != item3 and item3 != item1:
        if item1*item2*item3 < 201:
          ans.append(item1*item2*item3)
for item1 in prime:
  for item2 in prime:
    if item1 != item2:
      if (item1**3)*item2 < 200:
        ans.append((item1**3)*item2)
ans = list(set(ans))
n = int(input())
print(len(list(filter(lambda x:x<=n ,ans))))

Solution (Python):

import math

n = int(raw_input())
y_list = [[]]
cnt = 0
cnt_y = 0

for i in range(1,n+1,2):
    ri = (i>>1) 
    for j in range(3,ri,2):
        if i%j == 0: cnt_y += 1
    if cnt_y + 2 == 8: cnt += 1
    cnt_y = 0

print cnt

Solution (Python):
N = int(input())
if N <= 104:
    print(0)
else:
    ki = []
    for i in range(105, N + 1):
        if i % 2 == 1:
            ki.append(i)
    yakusuu = []
    for i in ki:
        count = 0
        for j in range(1, i + 1):
            if i % j == 0:
                count += 1
        if count == 8:
            yakusuu.append(i)
    print(len(yakusuu))

Solution (Python):
N = int(input())
countans = 1
if(N < 105):
  print(0)
elif(N < 107):
    print(1)
else:
    for i in range(107, N+1, 2):
        count = 1
        for j in range(1, int(N/2)):
            if(i%j == 0):
                count += 1
        if(count == 8):
            countans += 1
    print(countans)

Solution (Python):



import math

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


N = int(input())
ans = 0
for i in range(1, N + 1, 2):
    if int(factoring(i)) == 8:
        ans += 1 

print(ans)

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

for j in range(1,N+1):
  b = 0
  for i in range(1,j+1):
    if j % i == 0:
      b += 1
  if b == 8 and j % 2 == 1:
    a+=1
    
print(a)

Solution (Python):
def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff

def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a

n = int(input())

cnt = 0
for x in range(n + 1):
    if x % 2 == 1:
        if divisor_num(x) == 8:
            cnt += 1
print(cnt)

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):
    count = 0
    for j in range(1,i,2):
        if i % j == 0:
            count += 1
    if count == 7:
        Ans += 1

print(Ans)

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):
N = int(input())
ans = 0
for i in range(1, N+1, 2):
    count = 0
    for j in range(1, i+1):
        if i%j==0:
            count += 1
    if count == 8:
        ans += 1
        
print(ans)

Solution (Python):
n=int(input())
ans=int(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):
n=int(input())+1
res=0
for i in range(1,n):
	if i%2==0:
		continue
	s=0
	for j in range(1,i+1):
		if i%j==0:
			s+=1
	if s==8:
		res+=1
print(res)

Solution (Python):
N = int(input())
c = 0
for i in range(1,N+1):
    r = []
    if i % 2 != 0:
        for j in range(1,i+1):
            if i % j == 0:
                r.append(j)
        if len(r) == 8:
            c+=1
print(c)

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
total = 0

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

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

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

print(count)

Solution (Python):
n = int(input())
count = 0
check = 0
for j in range(1, n+1):
    if j % 2 == 0:
        continue
    for i in range(1, j):
        if j % i == 0:
            check += 1
    if check == 7:
        
        count += 1
    check = 0
print(count)

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

x = [0]*(N+1)
for i in range(1,N+1):
    for j in range(1,N+1,2):
        if j % i == 0:
            x[j]+=1
ans = 0
for i in x:
    if i == 8:
        ans +=1
print(ans)

Solution (Python):
a=int(input());
r=0;
for i in range(1, a+1, 2):
    c=0;
    for j in range(2, i):
        if (i % j == 0):
            c+=1;
    if (c==6): r+=1;
print(str(r));

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

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

        if count == 8:
            cnt += 1

print(cnt)

Solution (Python):





def main(n):
    if n < 105:
        print(0)
        return
    so_list = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
    chi_list = [0 for _ in range(len(so_list))]
    retval = 0
    for a in range(105,n + 1):
        t = a
        
        if 0 == t%2:
            continue
        t_count = 0
        for s in range(len(so_list)):
            so = so_list[s]
            
            if 0 == t%so:
                
                t_count += 1
            
            while 0 == t%so:
                
                t /= so
                
                t_count += 1
            if t == 1:
                if t_count == (8 - 2):
                    retval += 1
                break
    print(int(retval))
            
    
if __name__ == '__main__':
    try:
        n = int(input().strip())
        main(n)
    except EOFError:
        pass

Solution (Python):

import sys

def main():
    n = int(sys.stdin.readline().rstrip())
    if n < 105:
        print(0)
    else:
        z = [(i, 1) for i in range(107,n+1, 2)]
        for i in range(3, n+1, 2):
            z = list(map(lambda x: (x[0], x[1]+1) if x[0]%i==0 else x, z))
        c = len(list(filter(lambda x: x[1]==8, z)))
        print(c+1)
if __name__ == '__main__':
    main()

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

if n < 105:
    ans = 0
elif n < 135:
    ans = 1
elif n < 165:
    ans = 2
elif n < 189:
    ans = 3
elif n < 195:
    ans = 4
else:
    ans = 5

print(ans)

Solution (Python):


def main():
    a = int(input())
    minNum = 3 * 5 * 7
    if a < minNum:
        print(0)
        return
    elif a <= minNum + 1:
        print(1)
        return

    count = 1
    if a % 2 == 1:
        a = a + 1
    for n in range(minNum + 2, a, 2):
        if countDevisor(n) == 8:
            count = count + 1

    print(count)


def factorize(num):
    facts = []
    n = num
    base, expo = 2, 0
    while base * base <= n:
        while n % base == 0:
            n = n // base
            expo = expo + 1
        if expo > 0:
            facts.append((base, expo))
        base = base + 1
        expo = 0

    if n > 1:
        facts.append((n, 1))

    return facts


def countDevisor(num):
    facts = factorize(num)
    count = 1
    for _, expo in facts:
        count = count * (expo + 1)
    return count


if __name__ == '__main__':
    main()

Solution (Python):
def prime_t(t):
    i=2
    while i**2<=t:
        if t%i==0:
            return 0
        i+=1
    return 1

def prime_list(tt):
    p_list=[]
    for i in range(2,tt+1):
        if prime_t(i):
            p_list.append(i)
    return p_list

l=prime_list(201)

d={}

n=int(input())
chk=tmp=1
ans=0

for p in range(3,n+1,2):
    for i in l:
        chk=1
        while p%i==0:
            p//=i
            chk+=1
        tmp*=chk
    if tmp==8:
        ans+=1
    tmp=1
print(ans)

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

Solution (Python):
n = int(input())
arr = [105, 135, 165, 189, 195]
print(sum([1 for x in arr if n >= x]))

Solution (Python):
def main():
    n = int(input().strip())

    cnt = 0
    for i in range(1, n+1, 2):
        m = i
        li = []
        for j in range(1, n+1, 2):
            if m % j == 0:
                li.append(j)

        if len(li) == 8:
            cnt += 1

    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):











prime = [3, 5, 11, 13, 17]

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):
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
c = 0
for i in range(1,N+1,2):
    t = 0
    for j in range(1,i+1):
        if i%j == 0:
            t += 1
    if t >= 8:
        c += 1
print(c)

Solution (Python):
N = int(input())
ans = 0
for i in range(1, N+1):
    cnt = 0
    for j in range(1, i + 1):
        if (i % j == 0):
            cnt += 1
    if (cnt == 8 and ((i % 2) == 1)):
        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):
li=int(input())

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

Solution (Python):
def divisors(n):
    l = []
    for i in range(1, n+1):
        if n % i == 0:
            l.append(i)
    return l


n = int(input())
cnt = 0
for n in range(1, n+1, 2):
    d = divisors(n)
    if len(d) == 8:
        cnt += 1
print(cnt)

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

Solution (Python):
n = int(input())
def make_prime_list_2(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]
import math
def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(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
count = 0
for i in range(1,n+1):
    if (search_divisor_num_1(i) == 8) and (i % 2 != 0):
        count += 1
print(count)

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

if n<=104:
    print(0)
elif n>=105 and n<=134:
    print(1)
elif n>=135 and n<=164:
    print(2)
elif n>=165 and n<=188:
    print(3)
elif n>=189 and n<=194:
    print(4)
elif n>=195:
    print(5)

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



def count_divisor(num):
    c = 0
    for i in range(1, num + 1):
        if num % i == 0:
            c += 1
    return c


n = int(input().strip())

count = 0
for i in range(1, n + 1, 2):
    if count_divisor(i) == 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):
import numpy as np


def factor_num(N):
    factor = {}
    for i in range(2, int(N)):
        while N % i == 0:
            N /= i
            factor[i] = factor.get(i, 0) + 1

    return np.prod(list(map(lambda x: x+1, factor.values())))


N = int(input())
cnt = 0
for i in range(1, N+1):
    if i % 2 == 1 and factor_num(i) == 8:
        cnt += 1

print(cnt)

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

k = [i for i in range(1, n + 1) if i % 2 == 1]

res = 0

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

print(res)

Solution (Python):
n = int(input())
ans = []

for i in range(1, 200, 2):
    cnt = 0
    for j in range(1, i + 1):
        if i % j == 0:
            cnt += 1

        
        if cnt == 8:
            ans.append(i)


ans2 = []
for k in ans:
    if k <= n:
        ans2.append(k)

print(len(ans2))

Solution (Python):
n = int(input())
ans_list = []
for i in range(1, n + 1):
    if i % 2 == 1:
        count = 0
        for j in range(1, i + 1):
            if i % j == 0:
                count += 1
        if count == 8:
            ans_list.append(i)
    else:
        continue
print(len(ans_list))

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

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

def enum(i):
    result = []
    j = 1
    while j**2 <= i:
        if i % j == 0:
            result.append(j)
            
            
            if j**2 != i:
                result.append(n/j)
                
        j += 1
    return result

num = 0
for i in [i for i in range(1,n+1) if i %2 ==1]:
    result = enum(i)
    if len(result) == 8:
        num += 1
print(num)

Solution (Python):
from collections import defaultdict
def f(n):
  dd=defaultdict(int)
  c=[2,3,5,7,11,13,17,19,23,29,31]
  i=0
  while i<11 and n//c[i]:
    while i<11 and n%c[i]==0:
      dd[c[i]]+=1
      n=n//c[i]
    i+=1
  r=1
  for i in dd.values():
    r*=(i+1)
  return r

n=int(input())

l=[i for i in range(1,n+1,2)]
print(sum([1 for i in l if f(i)==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())
rst = 0
for i in range(1, n + 1) :
    if i % 2 == 0 : continue
    count = 0
    for k in range(1 , i + 1) : 
        if i % k == 0 : count += 1
    if count == 8 : 
        rst += 1
    
print(rst)

Solution (Python):
n = int(input())
print(len([a for a in range(1,n+1) if a in [105,135,165,195,189]]))

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

ans()

Solution (Python):
import sys

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    count = 0
    for i in range(1, N+1, 2):
        yakusu_count = 0
        for j in range(1, i+1):
            if i % j == 0:
                yakusu_count += 1
        if yakusu_count == 8 :
            count += 1
    print count


if __name__ == '__main__':
    main()

Solution (Python):
ip = input()
inputNum = int(ip)
totalCount = 0
for i in range(1,inputNum + 1):
    count = 0
    if i % 2 == 1:
        for j in range(1,i+1):
            if i % j == 0:
                count = count + 1
        if count == 8:
                totalCount = totalCount + 1

print(totalCount)

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

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):
n = int(input())
a = 0
i = 1
while i <= n:
    c = 0
    j = 1
    while j <= i:
        if i % j == 0:
            c += 1
        j += 1
    if c == 8:
        a += 1
    i += 2
print(a)