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


cn = 0

cy = 0

if n < 105:
    print(0)
    sys.exit()
    
for i in range(105, n+1):
    if i % 2 == 0:
        continue

    for j in range(1, i+1):
        if i % j == 0:
            cy += 1
    if cy == 8:
        cn += 1
    cy = 0
print(cn)

Solution (Python):
print([[i%j for j in range(2,i)].count(0) for i in range(1,int(input())+1,2)].count(6))

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

Solution (Python):
n = int(input())
divs = [1]*(n + 1)
for i in range(3, n + 1, 2):
    for j in range(3, n + 1, 2):
        if i % j == 0:
            divs[i] = divs[i] + 1

print(len([x for x in range(len(divs)) if divs[x] == 8]))

Solution (Python):



def main():
    n = int(input())
    count = 0

    for num in range(1, n + 1, 2):
        d_count = 0
        for divnum in range(1, num + 1):
            if num % divnum == 0:
                d_count += 1

        if d_count == 8:
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Solution (Python):
lst = [105, 135, 165, 189, 195]

n = int(raw_input())
ans = 0
for i in range(0, 5):
	if lst[i] <= n: ans = ans + 1

print ans

Solution (Python):
print([[i%j for j in range(1,i)].count(0) for i in range(1,int(input())+1,2)].count(7))

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

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

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

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


zero_seven = 0
one_three = [a * (b ** 3) for a in prime for b in prime if a != b]
one_three = [i for i in one_three if i <= 200]
one_one_one = [a * b * c for a in prime for b in prime for c in prime
               if a != b and b != c and c != a]
one_one_one = [i for i in one_one_one if i <= 200]

ans = sorted(set(one_three + one_one_one))
if N <= 104:
    print(0)
elif 105 <= N <= 134:
    print(1)
elif 135 <= N <= 164:
    print(2)
elif 165 <= N <= 188:
    print(3)
elif 189 <= N <= 194:
    print(4)
elif 195 <= N:
    print(5)

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

yaks = []

for i in range(1, N + 1) :
    cnt = 0
    
    for j in range(1, i) :
        if i % j == 0 :
            cnt += 1
            
    if cnt == 7 and i % 2 != 0:
        yaks.append(i)

print(len(yaks))

Solution (Python):
n = int(input())
m =  [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5]

print(m[n - 1])

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

for num in range(1, N+1, 2):
    divisor = 0
    for devide in range(1, N+1, 2):
        if num % devide == 0:
            divisor += 1
        if divisor > 8:
            break
    if divisor == 8:
        ans += 1

print(ans)

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



if __name__ == "__main__":
    main()

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

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

def divlist(n):
    if n < 1:
        return []
    elif n == 1:
        return [1]
    else:
        div = [1]
        for i in range(2, n + 1):
            if n % i == 0:
                div.append(i)
        return div


ans = []

for i in range(1,N+1):
    if i % 2 == 0:
        pass
    elif len(divlist(i)) == 8:
        ans.append(i)

print(len(ans))

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

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

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

num = int(n)
kisu_array = []
yakusuu_array = []
kazu_list = 0
for i in range(1,num+1):
    if i%2 != 0:
        kisu_array.append(i)

for i in kisu_array:
    for j in range(1,i+1):
        if i% j == 0:
            yakusuu_array += "1"

            if len(yakusuu_array) == 8:
                kazu_list += 1
    yakusuu_array = []
                
print(kazu_list)

Solution (Python):
def div(x):
    ans = 0
    for i in range(1, x + 1):
        if x % i == 0:
            ans += 1
    return ans
n = int(input())
ans = 0
for x in range(1, n + 1, 2):
    if div(x) == 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 = int(input())

def factors(n):
    return sum(0 == n % (1 + x) for x in range(N))
print(sum(map(lambda x: factors(x) == 8, range(105, N+1, 2))))

Solution (Python):












p = [3,5,7,11,13]
import itertools
import numpy

typeA = list(map(list,list(itertools.combinations(p,3))))
for i in range(len(typeA)):
    typeA[i] = typeA[i][0]*typeA[i][1]*typeA[i][2]

typeB = list(map(list,list(itertools.permutations(p,2))))
for i in range(len(typeB)):
    typeB[i] = typeB[i][0]*typeB[i][1]**3

specialnumbers = typeA + typeB

n = int(input())
print(len(list(filter(lambda x : x <= n, specialnumbers ))))

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

Solution (Python):
def uo(x):
    if x == 1:
        return 1
    else:
        uouo = []
        uouo.append(1)
        for i in range(2,x//2+1):
            if x % i == 0:
                uouo.append(i)
        uouo.append(x)

        return len(uouo)

a = 0

for i in [i for i in range(int(input())+1)]:
    if i % 2 == 1 and uo(i) == 8:
        a += 1

print(a)

Solution (Python):
ans = 0
for i in range(105,int(input())+1,2):
    numdivs = 0
    for j in range(1,i+1):
        if i % j == 0:
            numdivs += 1
    if numdivs == 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):
a = int(input())
result = 0
for i in range(0, a):
    tmp = 0
    if (i+1) % 2 != 0:
        for j in range(0, i):
            if (i + 1) % (j + 1) == 0:
                tmp += 1
        if tmp == 7:
            result += 1

print(result)

Solution (Python):
import math

N = int(input())

ans = 0

def cal(n):
    limit = math.floor(math.sqrt(n))
    count = 0
    for i in range(1, limit+1):
        if n % i == 0:
            if n % i == i:
                count += 1
            else:
                count += 2
    return count

for i in range(1, N+1, 2):
    if cal(i) == 8:
        ans += 1

print(ans)

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

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

print(ans)

Solution (Python):

import math
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]
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
res = 0
for i in range(N+1):
    if search_divisor_num_1(i) == 8 and i % 2 == 1:
        res+=1
print(res)

Solution (Python):

N = int(input())

cnt = 0
primes = (3, 5, 7, 11, 13, 17) 


for prime in primes: cnt += int((prime ** 7 <= N))
               

for prime_a in primes:
    M_a = prime_a ** 3
    if M_a > N: break
    for prime_b in filter(lambda x: x != prime_a, primes):
        M_b = M_a * (prime_b ** 1)
        if M_b > N: break
        else: cnt += 1
        

for prime_a in primes:
    M_a = prime_a ** 1
    if M_a > N: break
    for prime_b in filter(lambda x: x > prime_a, primes):
        M_b = M_a * (prime_b ** 1)
        if M_b > N: break
        for prime_c in filter(lambda x: x > prime_b, primes):
            M_c = M_b * (prime_c ** 1)
            if M_c > N: break
            else: cnt += 1

print(cnt)

Solution (Python):


N = int(input())

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

Solution (Python):


N = int(input())


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

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

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

Solution (Python):
N=int(input())
num=0
for j in range(1,N+1,2):
    cnt=0
    for i in range(1,j+1):


        if j%i==0 :
            cnt=cnt+1
    if cnt==8 :

        num+=1
    cnt=0

print(num)

Solution (Python):
n = int(input())
ans = 0
for i in range(105, n+1, 2):
    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())
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 = 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())
r = 0

for i in range(3, n + 1, 2):
    c = 1

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

    if c == 8:
        r += 1

print(r)

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

for i in range(0, n, 2):
    c = 1

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

    if c == 8:
        r += 1

print(r)

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

for i in range(0, n, 2):
    c = 0

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

    if c == 8:
        r += 1

print(r)

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

for i in range(n):
    c = 0

    for j in range(i + 1):
        if (i + 1) % (j + 1) == 0:
            c += 1

    if (i + 1) % 2 != 0 and c == 8:
        r += 1

print(r)

Solution (Python):

    
def solve(N):
    ans = 0
    for i in range(1, N+1, 2):
        cnt = 0
        for j in range(1, N+1, 2):
            if i % j == 0:
                cnt += 1
        if cnt == 8:
            ans += 1
    return ans
            
        
if __name__ == "__main__":
    N = int(input())
    print(solve(N))

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 math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    r = 0
    for i in range(1,n+1,2):
        t = 0
        for j in range(1,i+1,2):
            if i % j == 0:
                t += 1
        if t == 8:
            r += 1
    return r



print(main())

Solution (Python):



def main():
    n = int(input())
    odds = [i for i in range(1, 201) if i % 2 == 1]
    ans = 0

    for j in range(1, n + 1):
        count = 0

        for odd in odds:
            if j % odd == 0:
                count += 1

        if count == 8:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from itertools import product

N = int(input())

A = [n for n in range(1, N + 1) if n % 2 == 1]

cntOuter = 0
for n1 in A:
    cntInner = 0
    for n2 in [n for n in A if n <= n1]:
        if n1 % n2 == 0:
            cntInner += 1
    if cntInner == 8:
        cntOuter += 1

print(cntOuter)

Solution (Python):
N=int(input())
ans=0
for i in range(3,N+1,2):
    count=1
    for p in range(1,i,2):
        if i % p ==0:
            count += 1
    if count==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):
a,c=int(input()),0
for b in [105,135,165,189,195]:
  if a>=b:c+=1

print(c)

Solution (Python):
n=int(input());print(sum(x<=n-100for x in[5,35,65,89,95]))

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

answer = 0

for m in range(1, n+1):
    if m % 2 == 0:
        continue

    d = [1, m]

    for i in range(2, m//2 + 1):
        if m % i == 0:
            d.append(i)

    if len(d) == 8:
        answer += 1

print(answer)

Solution (Python):
from collections import defaultdict as dd
from functools import reduce
d=[2,3,5,7,11,13,17,19,23,29,31]
cd=len(d)

def f(n):
  i=0
  pr=dd(int)
  while i<cd and n//d[i]!=0:
    while i<cd and n%d[i]==0:
      pr[d[i]]+=1
      n=n//d[i]
    i+=1
  
  if pr.values():
    return reduce(lambda x,y:x*y,map(lambda x:x+1,pr.values()))
  else:
    return 0

n=int(input())
print(sum([1 for i in range(1,n+1,2) if f(i)==8]))

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

if n >= 1 and n <= 104:
    print(0)

elif n >= 105 and 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())

have_8divisors = [105, 135, 165, 189, 195]

for k, v in enumerate(have_8divisors):
    if N < v:
        ans = k
        break
else:
    ans = len(have_8divisors)
print(ans)

Solution (Python):
n = int(input())
sosuu = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199]
ans = 0
for i in range(1,n+1,2):
    r = []
    tmp = 0
    for j in sosuu:
        tmp = 0
        while i%j==0:
            tmp += 1
            i //= j
        r.append(tmp)
    rr = 1
    for i in r:
        rr *= i+1
    if rr==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=int(input());L=[105,135,165,189,195];a=0
for i in L:a+=1 if i<=N else 0
print(a)

Solution (Python):
n = int(input())
list = [0] * 99 
for i in range(99):
    for j in range(i, 99, i * 2 + 3):
        list[j] += 1
print(list[:(n - 1) // 2].count(7))

Solution (Python):

l = [105,135,165,189,195,]

n = int(input())
cnt=0
for i in l:
    if i <= n:
        cnt += 1

print(cnt)

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

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

print(result)

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

Solution (Python):
def solv(x):
    if x % 2 == 0:
        return -1
    count = 0
    for i in range(1, x+1):
        if x % i == 0:
            count += 1
    return count


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

Solution (Python):
def func(m):
    return sum([m%i==0 for i in range(1, m+1)])
N = int(input())
print(sum([func(i)==8 for i in range(1, N+1, 2)]))

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
def cnt(n):
 if n%2==0:
  return 0
 ans = 0
 for i in xrange(1,n+1):
  if n%i==0:
   ans+=1
 return ans
n = int(stdin.readline())
res = 0
for i in xrange(1,n+1):
 if cnt(i)==8:
  res+=1
print res

Solution (Python):

N = int(input())


ans = 0

def judge(n):
	
	i = 1
	dic = set()

	while i ** 2 <= n:
		if n % i == 0:
			dic.add(i)
			dic.add(n // i)
		i += 1
	return len(dic) == 8

for i in range(1, N + 1, 2):
	ans += judge(i)

print(ans)

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

Solution (Python):
def d(K):
    res=0
    for i in range(1,K+1):
        if K%i==0:
            res+=1
    return res

N=int(input())
ans=0
for i in range(1,N+1):
    if i%2==0:
        continue
    if d(i)==8:
        ans+=1
print(ans)

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

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

c = 0
for i in range(1, N+1):
    if cnter(i) == 8 and i % 2 != 0:
        c += 1

print(c)

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

Solution (Python):
yakusu = [0 for _ in range(201)]
for i in range(1, 200+1):
    for j in range(1, 200+1):
        if i*j>200:
            continue
        yakusu[i*j] += 1

N = int(input())
ans = 0
for i in range(1, N+1, 2):
    if yakusu[i] == 8:
        ans += 1
print(ans)

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

if N < 105:
    print(0)
elif N >= 105 and N < 135:
    print(1)
elif N >= 135 and N < 165:
    print(2)
elif N >= 165 and N < 189:
    print(3)
elif N >= 189 and 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
  cnt=0
  for j in range(1,n+1):
    if i%j==0:
      cnt=cnt+1
  if cnt==8:
    ans+=1
print(int(ans))

Solution (Python):
def d(K):
    res=0
    for i in range(1,K+1):
        if K%i==0:
            res+=1
    return res

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

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

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

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

Solution (Python):
import numpy as np
N=int(input())
x=[105, 135, 165, 189, 195]

X=[N-x[i] for i in range(len(x))]
XX=np.where(np.array(X) < 0) 
if N<195:
  print(XX[0][0])
else:
  print(5)

Solution (Python):
N = int(input())
x = []
res = 0
for i in range(3, N+1, 2):
    if len(x) == 0:
        x.append(i)
    else:
        y = i
        z = {}
        flag = True
        while flag:
            flag = False
            for j in x:
                if y % j == 0:
                    y /= j
                    z.setdefault(j, 0)
                    z[j] += 1
                    flag = True
        if y == i:
            x.append(i)
        else:
            yakusu = 1
            for j in z.values():
                yakusu *= j + 1
            if yakusu == 8:
                res += 1
print(res)

Solution (Python):
from math import sqrt
from functools import reduce
from operator import mul


def factoring(n):
    f_list = [0 for _ in range(n + 1)]

    i = 2
    while n != 1:
        if n % i == 0:
            n /= i
            f_list[i] += 1

        else:
            i += 1

    return f_list



if __name__ == '__main__':
    n = int(input())
    targets = list(filter(lambda x: x % 2 != 0, range(1, n + 1)))

    count = 0
    for t in targets:
        s = reduce(mul, map(lambda x: x + 1, filter(lambda x: x != 0, factoring(t))), 1)
        if s == 8:
            count += 1

    print(count)

Solution (Python):
from collections import Counter

N = int(input())

if N <= 2:
    print(0)
else:
    count = 0
    for ii in range(3, N+1, 2):
        s = ii
        num = []
        for jj in range(3, s+1, 2):
            if s % jj == 0:
                s = s // jj
                num.append(jj)
                break
        if s == 1:
            continue
        for jj in range(num[-1]+2, s+1, 2):
            if s % jj == 0:
                s = s // jj
                num.append(jj)
                break
        if s == 1:
            continue
        for jj in range(num[-1]+2, s+1, 2):
            if s % jj == 0:
                count += 1
                break
    print(count)

Solution (Python):
import math

def divisorGenerator(n):
    large_divisors = []
    for i in range(1, int(math.sqrt(n) + 1)):
        if n % i == 0:
            yield i
            if i*i != n:
                large_divisors.append(n / i)
    for divisor in reversed(large_divisors):
        yield divisor

n = int(input())
output = 0
for i in range(1, n + 1):
	if(i % 2 != 0):
		if(len(list(divisorGenerator(i))) == 8):
			output += 1
		
print(output)

Solution (Python):


def main():
    n = int(raw_input())

    if n <= 8:
        print(0)
        exit()

    ans = 0
    for i in range(1, n + 1)[::2]:
        a = cal_yakusuu(i)
        if a:
            ans += 1

        i += 1

    print(ans)


def cal_yakusuu(odd):
    ret = False
    ct = 0
    for i in range(1, odd + 1):
        if odd % i == 0:
            ct += 1
            if ct > 8:
                ret = False

    if ct == 8:
        ret = True

    return ret


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
if N <=104:
    print(0)
    
elif N <= 106:
    print(1)

else:
    if N%2 != 0:
        num = list(range(105, N+1))
        kotae = list(range(1, N+2, 2))
    else:
        num = list(range(105, N))
        kotae = list(range(1, N, 2))
        
    num = num[::2]
    ans = [0] * len(num)
    
    for index, i in enumerate(num):
        for t in kotae:
            if i%t ==0:
                ans[index] += 1
    print(len([1 for x in ans if x>=8]))

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

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

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

for i in range(1,n+1,2):
    if(count_divisor(i) == 8):
        result+=1
print(result)

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())
print(0 if n<105 else 1 if n<135 else 2 if n<165 else 3 if n<189 else 4 if n<195 else 5)

Solution (Python):
from bisect import bisect_right

n = int(input())

print(bisect_right([105, 135, 165, 189, 195], n))

Solution (Python):
import math
import functools

def find_divisor(n):
    sqrt = math.ceil(math.sqrt(n))
    divisors = {}
    target = n
    for i in range(2, sqrt):
        while target % i == 0:
            target = target // i
            if i in divisors:
                divisors[i] += 1
            else:
                divisors[i] = 1
    return divisors


N = int(input())
counter = 0

for i in range(1, N + 1):
    if i % 2 == 0:
        continue
    divisors = find_divisor(i)
    values = divisors.values()
    if divisors and functools.reduce((lambda x, y: x * y), map(lambda x: x + 1, values)) == 8:
            counter += 1

print(counter)

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

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

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

Solution (Python):
a = int(input())
 
if a<105:
    print(0)
elif 105<= a < 135:
    print(1)
elif 135<= a < 165:
    print(2)
elif 165<= a < 189:
    print(3)
elif 189<= a < 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):
N=int(input())
count=0
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):


from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(10000000)
N = 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):
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')
else:
  print('5')

Solution (Python):


N = int(input())


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

if N < 105:
    print(0)
else:
    ans = 0
    for i in range(N, 104, -1):
        if i % 2 != 0:
            tmp = divisor_num(i)
            if tmp == 8:
                ans += 1
    print(ans)

Solution (Python):
def divisors_num(x):
    foo = 0
    p = 1
    while p * p <= x:
        if x % p == 0:
            q = x / p
            if p != q:
                foo += 2
            else:
                foo += 1
        p += 1
    return foo

def main():
    n = int(raw_input().strip())
    foo = 0
    for k in xrange(1, n + 1, 2):
        if divisors_num(k) == 8:
            foo += 1
    print foo

if __name__ == '__main__':
    main()

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)