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

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

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)
    return divisors

cnt=0
for i in range(1,n+1,2):
  l=divisore(i)
  if len(l)==8:
    cnt+=1
print(cnt)

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

Solution (Python):
def count_dividers(n):
    dividers = {i for i in range(1, int(n ** 0.5) + 1) if n % i == 0}
    dividers = dividers | {n // d for d in dividers}
    return len(dividers)


N = int(input())

print(len([0 for n in range(105, N + 1, 2) if count_dividers(n) == 8]))

Solution (Python):
import numpy as np

n = int(input())
l = [0 for i in range(0, 201)]

for i in range(1, 201):
    for j in range(i, 201):
        if j/i == int(j/ i):
            l[j] += 1

l = np.array(l[1:n+1:2])>=8
print(sum(l))

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

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

def countOfDivisors(num: int) -> bool:
    result = []
    for i in range(1, int(num ** 0.5) + 1):
        if num % i == 0:
            result.append(i)
            if i != num // i:
                result.append(num // i)

    return True if len(result) == 8 else False

result = 0
for tmp in range(1, num + 1):
    if tmp % 2 == 0: continue
    if countOfDivisors(tmp): result += 1

print(result)

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

for i in range(1, N+1, 2):
    count = 1
    for j in range(1, int(i/2)+2, 2):
        if (i/j).is_integer():
            count += 1

    if count == 8:
        ans += 1

print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    if 1<=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)
resolve()

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

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

Solution (Python):
n = int(input())
lis = [x for x in range(1, n+1, 2)]
ans = 0

for a in lis:
  lis2 = []
  for b in range(1, a+1):
    if a % b == 0:
      lis2.append(b)
  if len(lis2) == 8:
    ans += 1

print(ans)

Solution (Python):
import math
import copy
from queue import Queue
import heapq
import numpy as np

MOD = 5000000007

n = int(input())

















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

print(sum)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


n = I()
prime = [3, 5, 7, 11, 13, 17, 19]
A = {a**7 for a in prime if a**7<200}
B = {a*b**3 for a, b in permutations(prime, 2) if a*b**3<200}
C = {a*b*c for a, b, c in permutations(prime, 3) if a*b*c<200}
D = A | B | C
ans = 0
for i in range(n+1):
    if i % 2 == 1 and i in D:
        ans += 1
print(ans)

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = np.zeros(N+1)
for i in range(1, N+1):
    A[i::i] += 1

A = A[1::2]
answer = (A==8).sum()
print(answer)

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()

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)
    divisors.sort()
    return divisors

answer = 0
for i in range(1, N+1, 2):
    d = make_divisors(i)
    if len(d) == 8:
        answer += 1

print(answer)

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

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    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 len(divisors)
    ans=0
    for i in range(1,n+1,2):
        if make_divisors(i)==8:
            ans+=1
    print(ans)

resolve()

Solution (Python):
import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

count=0
n=int(input())
for i in range(1, n+1, 2):
  ans=1
  c=collections.Counter(prime_factorize(i))
  clist = c.values()
  for j in clist:
    ans *= (j+1)
  if ans == 8:
    count += 1
    
print(count)

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

Solution (Python):
import math
import sys
n = int(sys.stdin.readline())
ans = 0
for i in range(3, n + 1, 2):
    
    count = 0
    for j in range(1, int(math.sqrt(i)) + 1):
        if i % j == 0:
            
            count += 2
    if count == 8:
        
        ans += 1
print(ans)

Solution (Python):
import numpy as np
n=int(input())

ans=0

for k in range(n+1):
    if k%2==1:
        count=0
        m=int(np.sqrt(k)+1)
        for i in range(m):
            a=i+1
            if(k%a==0):
                count+=1
        if count==4:
            ans+=1

print(ans)

Solution (Python):
n = int(input())
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
count = 0
for i in range(1, n + 1, 2):
    if len(make_divisors(i)) == 8:
        count += 1
print(count)

Solution (Python):


import sys
import itertools

def main():
    n = int(sys.stdin.readline())
    
    ans_count = 0
    for i in range(1, n+1, 2):
        count = 1 
        for j in range(1, i//2):
            count = count + 1 if i % j == 0 else count
        ans_count = ans_count + 1 if count==8 else ans_count
    print(ans_count)
            
                
    
if __name__ == "__main__":
    main()

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

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

def factorization(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([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

ans = 0

for i in range(1,n+1,2):
    fact = factorization(i)
    sum = 1
    for j in fact:
        sum *= j[1]+1
    if sum == 8:
        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, int(i ** 0.5) + 1):
        if i % j == 0:
            count += 2
    if int(i ** 0.5) ** 2 == i:
        count -= 1
    if count == 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,n+1): 
    if i%j==0 : 
      cnt+=1
  if cnt==8 and i%2==1:
    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, n+1):
        if i % j == 0:
            count += 1
    if count == 8:
        ans += 1

print(ans)

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

Solution (Python):
import math

n=int(input())
count,cnt=0,0

for i in range(1,n+1,2):
  for j in range(1,math.ceil(i/2)):
    if i%j==0:
      count+=1
      
  if count+1==8:
    cnt+=1
    
  count=0
  
print(cnt)

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

Solution (Python):
def divisor_list(n):
    ret = set()
    i = 1
    while i * i <= n:
        if n % i == 0:
            ret.add(i)
            ret.add(n // i)
        i += 1
    return ret


N = int(input())

ans = 0
for i in range(N+1):
    A = divisor_list(i)
    oddcnt = 0
    for a in A:
        if a % 2 == 1:
            oddcnt += 1
    if oddcnt == 8:
        ans += 1
print(ans)

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

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


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

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

print(ans)

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
ans = []
n = int(input())
for i in range(3,200,2):
    tmp = len(make_divisors(i))
    if tmp == 8:
        ans.append(i)
m = 0
for tmp in ans:
    if tmp <= n:
        m+=1
print(m)

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

ans = 0
n = int(input())
if(n >= 105):
    for i in range(105, n + 1, 2):
       divcnt = a(i)

       if (divcnt == 8):
           ans = ans + 1
    

print(0 if(n < 105) else ans)

Solution (Python):





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

    ans = 0
    for n in range(1, N+1, 2):
        n_yakusu = 0
        for m in range(1, n+1):
            if n % m == 0:
                n_yakusu += 1
        if n_yakusu == 8:
            ans += 1
    
    return ans


print(main())

Solution (Python):

import sys

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement


from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter





j=0
k=0
n=3
r=1
a=[0]






"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''


'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''




'''
素数の判定
'''
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  

'''
def factorial(x, mod=10**9+7):
    
    
    
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''
'''
試し割り法で素因数の種類とその数を出してる
'''
def factorization(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([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr










def main():

    steps=0
    state=0
    w=1
    j=0
    k=0
    sum=0
    ans=0
    n=int(input())
    for i in range(1,n+1,2):
     
     falis=factorization(i)
     
     
     for j in range(len(falis[:])):
             
             if sum==0:
              sum =falis[j][1]+1
             else:
              sum=sum*(falis[j][1]+1)
             
     if sum==8:
         ans +=1
     sum=0
    print(ans)

    
    
    
    
    




    
        
    
    

    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    
        
        
    
    
        
        
    


    "1行1つの整数を入力を取得し、整数と取得する"
    
    
    "12 21 332 とか入力する時に使う"
    "1行に複数の整数の入力を取得し、整数として扱う"
    
    



    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]
    

    ls = ["a", "b", "c", "d", "e"]


    
    

    
    

    
    
    
    
    
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
n=int(input())
a=[0]*(n+1)

for i in range(1,n+1,2):
	for j in range(1,n+1):
		if i%j==0:
			a[i]+=1
			
print(a.count(8))

Solution (Python):
N=int(input())
def prime(n):
  cnt=0
  for s in range(1,n+1):
    if n%s==0:
      cnt+=1
    
  return cnt

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

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

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

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


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

for i in range(1, N+1, 2):
    if len(make_divisors(i)) == 8:
        cnt += 1

print(cnt)

Solution (Python):
n=int(input())
l=[]
ans1=0
for i in range(1,n+1):
    if i%2!=0:
        l.append(i)
for j in range(len(l)):
    ans=0
    for k in range(1,l[j]+1):
        if l[j]%k==0:
            ans+=1
    if ans==8:
        ans1+=1
print(ans1)

Solution (Python):

"""
Created on Wed May 13 16:03:16 2020

@author: shinba
"""
import bisect

n = int(input())

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

print(bisect.bisect(A,n))

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

def check8(n):
    cnt = 0
    for i in range(1,n+1):
        if n % i == 0:
            cnt += 1
    if cnt == 8:
        return True
    else:
        return False

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

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

Solution (Python):
def divisor(x):
  i=1
  table = []
  while i * i <= x:
    if x%i == 0:
      table.append(i)
      table.append(x//i)
    i += 1
  table = list(set(table))
  return table

n=int(input())

ans=0
for i in range(1,n+1,2):
  cnt = len(divisor(i))
  if cnt == 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):
def get_dividers(n):
    low_dividers = {i for i in range(1, int(n ** 0.5) + 1) if n % i == 0}
    high_dividers = {n // divider for divider in low_dividers}
    return low_dividers | high_dividers


N = int(input())
print(len([i for i in range(105, N + 1, 2) if len(get_dividers(i)) == 8]))

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

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

counter = 0
ans = 0
for x in range(1,n+1,2):
    for y in range(1,x+1):
        if(x % y == 0):
            counter += 1
    if(counter == 8):
        ans += 1
    counter = 0
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):
def main():
    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):
            count += 1 if i % j == 0 else 0
        if count == 8:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

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

N = int(input())

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

print(cnt)

Solution (Python):
import math


def prime_check(x): 
    if x==2:
        return True,2
    elif x%2==0:
        return False,2
    else:
        limit=int(math.sqrt(x))
        for factor in range(3,limit+1,2):
            if x%factor==0:
                return False,factor
        return True,x


def prime_factorization(x): 
    factor_list=[]
    factor_dictionary={}
    factor_set=set()
    judge,factor=prime_check(x)
    while True:
        factor_list.append(factor)
        if factor in factor_set:
            factor_dictionary[factor]+=1
        else:
            factor_dictionary[factor]=1
            factor_set.add(factor)

        if judge:
            return factor_list,factor_dictionary,factor_set
            break
        else:
            x//=factor
            judge,factor=prime_check(x)


def total_number_of_factors(x):
    List,Dict,Set=prime_factorization(x)
    Total=1
    while Set:
        factor=Set.pop()
        Total*=Dict[factor]+1
    return Total


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

Solution (Python):
import math

def prime_check(x): 
    if x==2:
        return True,2
    elif x%2==0:
        return False,2
    else:
        limit=int(math.sqrt(x))
        for factor in range(3,limit+1,2):
            if x%factor==0:
                return False,factor
        return True,x


def prime_factorization(x): 
    factor_list=[]
    factor_dictionary={}
    factor_set=set()
    judge,factor=prime_check(x)
    while True:
        factor_list.append(factor)
        if factor in factor_set:
            factor_dictionary[factor]+=1
        else:
            factor_dictionary[factor]=1
            factor_set.add(factor)

        if judge:
            return factor_list,factor_dictionary,factor_set
            break
        else:
            x//=factor
            judge,factor=prime_check(x)


N=int(input())
ans=0
for i in range(1,N+1,2):
    List,Dict,Set=prime_factorization(i)
    Total=1
    while Set:
        element=Set.pop()
        Total*=Dict[element]+1
    if Total==8:
        ans+=1

print(ans)

Solution (Python):
def solve(N):
    ret = 0
    for i in range(3, N + 1, 2):
        div = 0
        for j in range(1, i + 1, 2):
            div += 1 if not i % j else 0
            if 8 < div:
                break
        ret += 1 if div == 8 else 0
    return ret

if __name__ == '__main__':
    N = int(input())
    print(solve(N))

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


n = int(input())
ans = 0
for i in range(11, n + 1, 2):
    res = make_divisors(i)
    if len(res) == 8:
        ans += 1
print(ans)

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

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,i+1):
        if j * j > i : break
        if j * j == i : cnt += 1
        elif i % j == 0 : cnt += 2

    if cnt == 8 : ans += 1

print(ans)

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

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

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

Solution (Python):
def solve(N):
    ret = 0
    for i in range(3, N + 1, 2):
        div = 0
        for j in range(1, i + 1, 2):
            div += 1 if not i % j else 0
            if 8 < div:
                break
        ret += 1 if div == 8 else 0
    return ret

if __name__ == '__main__':
    N = int(input())
    print(solve(N))

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

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

count = 0
for num in range(1, N+1):
    cnt = 0
    for i in range(1, num+1):
        if num%2==1 and num%i==0:
            cnt += 1
    if cnt >= 8:
        count += 1

print(count)

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

print(ans)

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

res=0

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

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


from math import sqrt

def divisor(num):
    max_num = int(sqrt(num))
    divisor_list = []
    for i in range(1, max_num + 1):
        if num % i == 0:
            divisor_list.append(i)
            divisor_list.append(num//i)
    sorted_divisor_list = sorted(divisor_list)
    return sorted_divisor_list

count=0
for num in range(1, n+1):
    if num % 2 == 0:
        continue
    if len(divisor(num)) == 8:
        count+=1

print(count)

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

Solution (Python):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()

ans=0
for k in range(105,n+1,2):
    c=0
    for i in range(1,k+1):
        if k%i==0:
            c+=1


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

Solution (Python):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()

ans=0
for k in range(105,n+1,2):
    c=0
    for i in range(1,int(k**0.5)+1):
        if k%i==0:
            c+=2
    if i**2==k:
        c-=1
    if c==8:
        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):
import fileinput

n = int(input())

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

print(c)

Solution (Python):
def trial_divide(n):
    ret = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            if n // i == i:
                ret += 1
            else:
                ret += 2
    return ret
        
def main():
    n = int(input())
    count = 0
    for i in range(1, n+1):
        if i % 2:
            if trial_divide(i) == 8:
                count += 1
    print(count)
        
if __name__=='__main__':
    main()

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

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

N = int(input())
ans = 0
for n in range(1,N+1):
  div = make_divisors(n)
  if len(div) == 8 and n%2 != 0:
    ans += 1

print(ans)

Solution (Python):
N = int(input())
L = [i for i in range(1,N+1) if i%2 != 0]
ans = 0
for i in L:
    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())
cnt=0

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

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