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):
def count_divisor(n):
    arr = []
    for i in range(1, int(n**0.5)+1):
        if n%i == 0:
            arr.append(i)
            arr.append(n//i)
    res = len(set(arr))
    return res

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

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

y = 0
def X(num):
  x = 0
  for i in range(1,num+1):
    if num%i == 0:
      x += 1
  return x
for j in range(1,N+1):
  if X(j) == 8 and j%2==1:
    y = y+1
print(y)

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 factoraization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp%i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])
    if (temp != 1):
        arr.append([n, 1])
    
    return arr
    
if __name__ == '__main__':
    N = int(input())
    
    num_lst = []
    for i in range(1, N + 1, 2):
        num_lst.append(i)
        
    result = 0
    
    for j in num_lst:
        
        count = 1
        x = factoraization(j)

        for t in range(len(x)):
            count *= (int(x[t][1]) + 1)
            
            if count == 8:
                result += 1
    
    print(result)

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def divisors(n):
    lower = []
    upper = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            lower.append(i)
            if i != n // i:
                upper.append(n // i)

    lower.extend(reversed(upper))
    return lower


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

    ans = 0
    for n in range(1, N + 1, 2):
        if len(divisors(n)) == 8:
            ans += 1

    print(ans)
    return


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import sys


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return len(lower_divisors + upper_divisors[::-1])


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    ans = 0
    for i in range(1, n + 1, 2):
        if make_divisors(i) == 8:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def count_divisors(n):
    count = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            count += 1
            if i != n // i:
                count += 1
    return count
def main():
    n = int(input())
    ans = 0
    for i in range(1, n + 1, 2):
        if count_divisors(i) == 8:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
if 1<=N and 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())
def num_factors(num):
    facts=2
    for i in range(2,num):
        if num%i == 0:
            facts += 1
    return facts

print(sum([num_factors(i)==8 for i in range(1,n+1) if i&1]))

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

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

def divs(n:int):
    divs = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divs.append(i)
            if i != n // i:
                divs.append(n//i)
    return len(divs)

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

print (ans)

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

print(ans)

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

ans = 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:
        ans += 1
print(ans)

Solution (Python):









n = int(input())

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

ans = 0
for i in range(1, n+1,2):
    if 8 == func(i):
        ans+=1
print(ans)

Solution (Python):
N=int(input())
if N<105:
    print(0)
elif N==105:
    print(1)
else:
    ans=1
    for n in range(106,N+1):
        if n%2:
            K=n//2
            y=0
            
            for k in range(2,K+1):
                if n%k==0:
                    y+=1
                    
            if y==6:
                
                ans+=1
    print(ans)

Solution (Python):


def get_input() -> int:
    """
    標準入力を取得する.

    Returns:\n
        int: 標準入力
    """
    N = int(input())

    return N


def divisor_count(n: int) -> int:
    """
    引数の約数の個数を取得する.

    Args:\n
        n (int): 引数

    Returns:\n
        int: 約数の個数
    """
    ans = 0
    i = 1
    while i * i <= n:
        if n % i == 0:
            ans += 1
            if i != n // i:
                ans += 1
        i += 1
    return ans


def main(N: int) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 整数（1 <= N <= 200）
    """
    
    ans = 0
    for n in range(1, N + 1, 2):
        if divisor_count(n) == 8:
            ans += 1

    
    print(ans)


if __name__ == "__main__":
    
    N = get_input()

    
    main(N)

Solution (Python):


N = int(input())


def divisor_count(n: int) -> int:
    ans = 0
    i = 1
    while i * i <= n:
        if n % i == 0:
            ans += 1
            if i != n // i:
                ans += 1
        i += 1
    return ans


ans = 0
for n in range(1, N + 1, 2):
    if divisor_count(n) == 8:
        ans += 1


print(ans)

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


def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

count=0
for i in range(1, N+1):
  if i%2==1 and len(make_divisors(i))==8:
    count+=1
print(count)

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

cnt = 0


def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


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

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

ans = 0

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

print(ans)

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    N = intinput()
    cnt = 0
    for n in range(1, N+1, 2):
        ans = 0
        for i in range(3, n, 2):
            if n % i == 0:
                ans += 1
            if ans > 6:
                break
        if ans == 6:
            cnt += 1

    
    print(cnt)

Solution (Python):
def abc106_b():
    n = int(input())
    have_8_divisors = 0

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

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

        result = count_up_divisor(i) == 8
        if result:
            have_8_divisors += 1

    print(have_8_divisors)

if __name__ == '__main__':
    abc106_b()

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

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


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

    result = count_up_divisor(i) == 8
    if result:
        have_8_divisors += 1

print(have_8_divisors)

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

for i in range(1, n + 1):

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

    result = cnt == 8
    if result:
        have_8_divisors += 1

print(have_8_divisors)

Solution (Python):
import copy
import math


def get_int():
    return int(input())

def get_string():
    return input()

def get_int_list():
    return [int(x) for x in input().split()]

def get_string_list():
    return input().split()

def get_int_multi():  
    return map(int, input().split())

def get_string_char_list():
    return list(str(input()))




'''
while (idx < n) and ():

    idx += 1
'''

def main():

    n = get_int()

    ans = 0

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

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


if __name__ == '__main__':
    main()

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

ans = 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:
        ans += 1
print(ans)

Solution (Python):
N=int(input())
 
ans=0
odd=[]
for i in range(1,N+1):
  if i%2!=0:
    odd.append(i)
    
if N  <104:
  pass
else:
  for i in range(105,N+1):
    if i%2!=0:
      tmp=0
      for j in odd:
        if i%j==0:
          tmp+=1
      if tmp==8:
        ans+=1 
print(ans)

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

    count_1 = 0
    for i in [_ for _ in range(1, N+1) if _ % 2 == 1]:
        count_2 = 0
        for j in range(1, i+1):
            if i % j == 0:
                count_2 += 1
        if count_2 == 8:
            count_1 += 1
    print(count_1)


if __name__ == "__main__":
    solve()

Solution (Python):
N = int(input())
big_count = 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  : big_count+= 1
print(big_count)

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

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

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    ans = 0
    for n in range(1, N+1, 2):
        cnt = 0
        for p in range(1, n+1):
            if n%p==0:
                cnt += 1
        if cnt==8:
            ans += 1
    print(ans)

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












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

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

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

print(m)

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

Solution (Python):
n=input()

s=0
yakusu=0



for i in range(1,int(n)+1):
    s=0
    if i%2!=0:
        for k in range(1,i+1):
            if i%k==0:
                s+=1    
    if s==8:
        yakusu+=1         

print(yakusu)

Solution (Python):
import math
N = int(input())
count = 0
def divisoros_count(n):
    num = 0
    for i in range(1,int(math.sqrt(n))+1):
        if n % i == 0:
            num += 1
            if n != i**2:
                num += 1
    return num

for i in range(1,N+1,2):
    if divisoros_count(i) == 8:
        count += 1

print(count)

Solution (Python):

import sys
input = sys.stdin.readline


def RD(): return input().rstrip()
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float,input().split()))

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


def main():
    num = I()
    result = 0
    for i in range(1,num+1,2):
        temp = len(make_divisors(i))
        if temp == 8:
            result += 1
    print(result)
        
if __name__ == "__main__":
    main()

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

def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
    
cnt = 0
for i in range(1, N+1):
    if i % 2 != 0 and len(divisor(i)) == 8:
        cnt += 1

print(cnt)

Solution (Python):
def divisors(n):
    d=[]
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            d.append(i)
            if i!=n//i:
                d.append(n//i)
    d.sort()
    return d
a=0
for i in range(1,int(input())+1):
    a+= i%2 and len(divisors(i))==8
print(a)

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

Solution (Python):
from math import ceil
def numdiv(n):
    c=0
    k=int((n)**0.5)
    for i in range(1,k+1):
        if n%i==0:
            c+=2
    if k==ceil(n**0.5):
        return c-1
    return c

c=0
n=int(input())
for i in range(3,n+1,2):
    if numdiv(i)==8:
        c+=1


print(c)

Solution (Python):
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()

if N < 105:
    print(0)
    exit()

ans = 0
for i in range(105,N+1,2):
    cnt = 0
    for q in range(1,int(i**0.5)+1):
        if i % q == 0:
            cnt += 2
    if cnt == 8:
        ans += 1
print(ans)

Solution (Python):
def check(n):
  d=[]
  for i in range(1,int(n**0.5)+1,2):
    if n%i==0:
      d.append(i)
      if i!=n//i:
        d.append(n//i)
  if len(d)==8: return True
  else: return False

r=[]
for i in range(1,int(input())+1,2):
  r.append(int(check(i)))
print(sum(r))

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

def divisor_pairs(n):
  
  
  pairs = 0

  
  i = 1

  while i * i <= n:
    if n % i == 0:
      pairs += 1
    i += 1
  return pairs

result = 0


for x in range(1, N+1, 2):
  if divisor_pairs(x) == 4:
    result += 1

print(result)

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

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

ans = 0
for n in range(3, N+1, 2):

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

print(ans)

Solution (Python):
import itertools
import numpy as np


def check_eight(n):
    div_list = []
    for i in range(3, n + 1, 2):
        if n % i == 0:
            while n % i == 0:
                n = n // i
                div_list.append(i)
        if n == 1:
            break

    answer_list = []
    for i in range(1, len(div_list)+1):
        comb = itertools.combinations(div_list, i)
        for c in comb:
            c = np.array(c)
            answer_list.append(c.prod())
    answer = len(set(answer_list)) + 1
    
    return answer == 8

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

    count = 0
    for n in range(1, N + 1, 2):
        count += check_eight(n)

    print(count)

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

Solution (Python):
def main():
    N = int(input())
    ans = 1
    if N < 105:
        print(0)
    elif N == 105:
        print(1)
    else:
        for i in range(106, N+1):
            temp = 0
            if i % 2 == 0:
                continue
            for j in range(1, N+1):
                if i % j == 0:
                    temp += 1
            if temp == 8:
                ans += 1
        print(ans)
main()

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

Solution (Python):
import math
import collections
import fractions
import itertools
import functools
import operator

def yakusu_rekkyo(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def solve():
    n = int(input())
    cnt = 0
    for i in range(1,n+1):
        hoge = 0
        for j in yakusu_rekkyo(i):
            if j%2 == 1:
                hoge += 1
        if hoge == 8:
            cnt += 1
    print(cnt)
    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
N=int(input())
ans=0
for x in range(1,N+1):
  if x%2==1:
    c=0
    for y in range(1,x+1):
      if x%y==0:
        c+=1
      if c>8:
        break
    if c==8:
      ans+=1
print(ans)

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

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

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

count = 0
divisors = 0

arrays = []
for i in range(n+1):
    arrays.append(False)

for i in range(n+1):
    if i % 2 == 1:
        divisors = 0
        for j in range(len(arrays)):
            arrays[j] = False
        for j in range(1,i+1):
             if i % j == 0:
                 arrays[j] = True
        for j in range(len(arrays)):
            if arrays[j]:
                divisors += 1
        if divisors == 8:
            count += 1

print(count)

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

divcnt = {n: 0 for n in range(1, (n + 1), 2)}
for i in range(1, (n + 1), 2):
    for j in range(i, (n + 1), (i * 2)):
        divcnt[j] += 1

ans = 0
for i in divcnt:
    if divcnt[i] == 8:
        ans += 1
print(ans)

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

Solution (Python):
ret = 0
for x in range(11, int(input()) + 1, 2):
    n = 2
    for y in range(2, x // 2 + 1):
        if x % y == 0:
            n += 1
    if n == 8:
        ret += 1
print(ret)

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

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

print(ans)

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

odd_prime = [3,5,7,11,13]
ans = 0

for i in range(3):
    for j in range(i+1,4):
        for h in range (j+1,5):
            if odd_prime[i] * odd_prime[j] * odd_prime[h] <= n:
                ans += 1

for i in range(1,5):
    if 3**3 * odd_prime[i] <= n:
        ans += 1
        
print(ans)

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

N = int(readline())

def count_div(x):
  div = set()
  for i in range(1, int(x ** 0.5) + 1):
    if x % i == 0:
      div.add(i)
      div.add(x // i)
  return len(div)

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

Solution (Python):
import itertools
N = int(input())
S = [3,5,7,11,13]

if N >= 189:
  ans = 2
elif N>= 135:
  ans = 1
else:
  ans = 0
A = list(itertools.combinations(S,3))

for x in A:
  a,b,c = x
  if a*b*c <= N:
    ans += 1
print(ans)

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

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

def main():
    cnt = 0
    n = int(input())
    for i in range(1,n+1,2): 
        k = 0
        for m in range(1,i+1):
            if i % m == 0:
                k += 1
        if k == 8:
            cnt += 1
    print(cnt)

if __name__=="__main__":
    main()

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

def main():
    cnt = 0
    n = int(input())
    for i in range(1,n+1):
        if i % 2 == 1: 
            k = 0
            for m in range(1,i+1):
                if i % m == 0:
                    k += 1
            if k == 8:
                cnt += 1
    print(cnt)

if __name__=="__main__":
    main()

Solution (Python):
N = int(input())
res = 0
for num in range(1, N + 1):
    if num % 2 == 1:
        cnt = 0
        for d in range(1, num + 1):
            if num % d == 0:
                cnt += 1
                if cnt > 8:
                    break
        if cnt == 8:
            res += 1
print(res)

Solution (Python):
n = int(input())
cnt = 0
def sympy(num):
  l = []
  for i in range(1, num+1):
    for j in range(1, num+1):
      if (i % 2 != 0) and (i*j == num):
        l.append(i)
  return l
for i in range(1, n+1):
  l = sympy(i)
  if (i % 2 != 0) and (len(l) == 8):
    cnt += 1
print(cnt)

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

for n in range(1, N+1):
    cnt = 0
    if n%2 == 0:
        continue
    for yaku in range(1, n+1):
        if n%yaku == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
        
print(ans)

Solution (Python):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
  
N = int(input())
count=0
for i in range(3,N+1):
  if i%2==1 and len(make_divisors(i))==8:
    count += 1
print(count)

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

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

Solution (Python):

def make_divisors(n): 
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors


import sys
input = sys.stdin.readline  
N = int(input())

count =0
for i in range(1,N+1,2):
    x =make_divisors(i)
    if len(x) ==8:
        count +=1
print(count)

Solution (Python):


n = int(input())


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

print(ans)

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

Solution (Python):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
ans = 0

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

print(ans)

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

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

Solution (Python):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
print(len(list(filter(lambda x: len(make_divisors(x)) == 8, range(1, n + 1,2)))))

Solution (Python):

def inputlist(): return [int(j) for j in input().split()]

def divisore(n):
    divisors=[]
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            divisors.append(i)
            if i!=n//i:
                divisors.append(n//i)
    divisors.sort(reverse=True)
    return divisors
N = int(input())
ans = 0
for i in range(1,N+1):
    if i % 2 == 0:
        continue
    li = divisore(i)
    if len(li) == 8:
        ans +=1
print(ans)