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


if __name__ == "__main__":
    solve()

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

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

Solution (Python):
def f(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
print(len([i for i in range(1,int(input())) if(i+1)%2==1 and len(f(i+1))==8]))

Solution (Python):
"""
for i in range(201):
    if i % 2 == 0:
        continue
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        print(i)
        
出力
105
135
165
189
195
"""
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
  for j in range(1,i+1):
    if i%j == 0:
      count += 1
  if i%2 == 1 and count == 8:
    ans += 1
print(ans)

Solution (Python):
n = int(input())
              
def primes(n):
    p = []    
    i = 1     
    while True:
        i += 1
        if i * i > n:
            break
        ok = True
        for j in p:
            if i % j == 0:
                ok = False
                break
        if ok:
            p.append(i)
    return p  
p = primes(n) 
              
ans = 0       
for i in range(1, len(p)):
    for j in range(i+1, len(p)):
        for k in range(j+1, len(p)):
            if p[i] * p[j] * p[k] <= n:
                ans += 1
              
for i in range(1, len(p)):
    for j in range(i+1, len(p)):
        if p[i] * p[i] * p[i] * p[j] <= n:
            ans += 1
print(ans)

Solution (Python):

n = int(input())
c = [0] * (n + 1)
for i in range(1, n + 1):
    for j in range(1, n // i + 1):
        c[j * i] += 1
print(sum(c[i] == 8 for i in range(1, n + 1, 2)))

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

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


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

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()

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


if __name__ == '__main__':
    main()

Solution (Python):
def yakusu(x):
    A=[]
    for i in range(1,x+1):
        if x%i==0:
            A.append(i)
    return(len(A))
    
n=int(input())
ans=0

for j in range(1,n+1,2):
    if yakusu(j)==8:
        ans+=1
print(ans)

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

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from math import factorial, sqrt, ceil, gcd
from functools import lru_cache, reduce
from decimal import Decimal
from operator import mul

INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)



class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


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 combinations_count(n, r):
    if n < r:
        return 0
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret

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, 2):
    if len(make_divisors(i)) == 8:
        ans += 1
print(ans)

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

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

Solution (Python):
import sys
from collections import defaultdict
array_8 = defaultdict(int)
N = int(input())
if not ( 1 <= N <= 200 ): sys.exit()

for A in range(2,N+1):
    if A % 2 == 1:
        for I in range(2,N // 2):
            if A % I == 0:
                array_8[A] += 1

result = 0
for J in array_8:
    if array_8[J] == 6:
        result += 1
print(result)

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

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

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

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

print(count)

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

answer = []
for i in range(1,n+1,2):
  check = 0
  for j in range(1,i+1):
    if (i) % j == 0:
      check += 1
      
  if check == 8:
    answer.append(i)
    
print(len(answer))

Solution (Python):
N=int(input())
L=[0 for i in range(N+1)]

for i in range(1,N+1):
    for j in range(1,N+1):
        if i*j<=N:
            L[i*j]+=1
cnt=0
for i in range(N+1):
    if i%2!=0 and L[i]==8:
        cnt+=1
print(cnt)

Solution (Python):
N = int(input())
l = [105, 135, 165, 189, 195]
for i in range(5):
    if N < l[i]:
        print(i)
        exit()
print(5)

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

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


def GetDivider(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 GetDivider(i) == 8:
        if i % 2 != 0:
            ans += 1
print(ans)

Solution (Python):
import math

def countDividers(n):
    divisors = []
    for i in range(1, int(math.sqrt(n))+1):
        if n % i == 0:
            divisors.append(i)
            divisors.append(int(n/i))
    return len(divisors)


if __name__ == '__main__':
    n = int(input())
    count = 0
    for i in range(1,n+1):
        if i %2 ==1 and countDividers(i) == 8:
            count += 1
           
    print(count)

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

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1):
    num = 0
    for j in range(1,n+1):
        if i%j == 0:
            num += 1
    if num == 8 and i%2 == 1:
        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):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
ans = 0
for i in range(105, n+1, 2):
  cnt = 1
  for k in range(3, int(i**0.5)+1, 2):
    if i % k == 0:
      cnt += 1
  if cnt == 4:
    ans += 1
print(ans)

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

Solution (Python):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    d = [0]*(n+1)
    for i in range(1, n+1):
        for j in range(i, n+1, i):
            d[j] += 1
    ans = 0
    for i in range(n+1):
        if i%2 and d[i] == 8:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

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

num_eight_divisors = 0

numbers = list(range(9, number + 1, 2))

for i in range(9, number + 1, 2):
    divisors = [1, i]

    for j in range(2, i):
        q, mod = divmod(i, j)

        if mod == 0:
            divisors.append(j)
            divisors.append(q)

    if len(set(divisors)) == 8:
        num_eight_divisors = num_eight_divisors + 1

print(num_eight_divisors)

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

ans = 0
sqrt = 1

for i in range(1,n+1,2):
    if i == sqrt*sqrt:
        sqrt += 1
        continue
    elif i > sqrt*sqrt:
        sqrt += 1
    count = 0
    for j in range(1,sqrt,2):
        if i%j == 0:
            count += 1
    if count == 4:
        ans += 1

print(ans)

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

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

print(ans)

Solution (Python):
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]
ans = 0
N = int(input())
for n in range(1, N+1):
    if n%2 != 0:
        if len(make_divisors(n)) == 8:
            ans += 1

print(ans)

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

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 len(lower_divisors + upper_divisors[::-1])


n = int(input())

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

print(ans)

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

def make_divisors(n):
    ans = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ans += 1
            if i != n // i:
                ans += 1
    return ans

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

print(ans)

Solution (Python):
""" tutorial02
    https://atcoder.jp/contests/abc106/tasks/abc106_b
"""
import sys
import math

def f(n):
    count = 0
    for j in range(1, int(math.sqrt(n)+1)):
        if n % j == 0:
            count = count + (2 if n / j != j else 1)
            if count > 8:
                break

    return count

def main(n):
    """ main
    """
    result = 0

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

    return result

if __name__ == "__main__":
    N = int(sys.stdin.readline())

    print(main(N))

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
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()
cnt = 0
for i in range(1, n+1, 2):
    divcnt = 0
    for j in range(1, i+1, 2):
        if i % j == 0:
            divcnt += 1
    if divcnt == 8:
        cnt += 1
print(cnt)

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

Solution (Python):


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

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

    return N


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

    Args:\n
        N (int): 1以上200以下の整数
    """
    
    ans = 0
    for n in range(1, N + 1, 2):
        divisors_count = 0
        for i in range(1, n + 1):
            if n % i == 0:
                divisors_count += 1
        if divisors_count == 8:
            ans += 1

    
    print(ans)


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

    
    main(N)

Solution (Python):


N = int(input())


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


print(ans)

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

cnt=0
ans=0

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

print(ans)

Solution (Python):

import sys
read = sys.stdin.read
def main():
    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

    n = int(input())
    r = 0
    for i1 in range(1, n + 1, 2):
        ifac = factorization(i1)
        ifacn = [i[1] for i in ifac]
        ifacn.sort()
        if ifacn == [1, 3] or ifacn == [1, 1, 1]:
            r += 1
    print(r)

if __name__ == '__main__':
    main()

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

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

a = 0 

for n in range(1, N+1):
  num = 0
  for i in range(1, n+1):
    if n % i == 0:
      num += 1
  
  if n % 2 == 1 and num == 8:
    a += 1

print(a)

Solution (Python):

def solve():
    ans = 0
    n=int(input())
    for i in range(1,n+1,2):
        div_list = []
        for j in range(1,int(i**0.5)+1):
            if i%j!=0:
                continue
            if i//j==j:
                div_list.append(j)
            else:
                div_list.append(i//j)
                div_list.append(j)
        if len(div_list)==8:
            ans+=1
    print(ans)

if __name__ == '__main__':
    solve()

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

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

print(a)

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

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

print(a)

Solution (Python):
import sys
import os
import math

N=int(input())
count = 0

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

    if yakusu == 8:
        count += 1

print(count)

Solution (Python):
ans = 0
def solve(n):
    global ans
    for i in range(1,n+1,2):
        div_list=[]
        for j in range(1,int((i+1)**0.5)+1):
            if i % j == 0:
                if (i//j)!=j:
                    div_list.append(i//j)
                    div_list.append(j)
                else:
                    div_list.append(j)
        if len(div_list) == 8:
            ans+=1

def main():
    n=int(input())
    solve(n)
    print(ans)

if __name__=='__main__':
    main()

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 len(lower_divisors + upper_divisors[::-1])


n = int(input())

ans = 0
for i in range(1, n + 1, 2):
    if make_divisors(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):
import sys





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


n = int(input())
ans = 0

"""if n <= 105:
    if n == 105:
        print(1)
    else:
        print(0)
    sys.exit()"""

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

Solution (Python):
import sys

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


n = int(input())
ans = 1

if n <= 105:
    if n == 105:
        print(1)
    else:
        print(0)
    sys.exit()

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

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

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

n = int(input())

ans = 0
for i in range(1, n + 1, 2):
    if divisor(i) == 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())
cnt = 0

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

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

a=[]
for i in range(1,201):
    s=0
    for j in range(1,int(i**0.5)+1):
        if i%j==0:
            s+=1
            if j != i//j:
                s+=1
    a.append(s)

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

print(ans)

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

for i in range(1, n+1):
  counter = 0
  
  if i%2==0:
    continue
  
  for i_i in range(1, i+1):
    if i%i_i == 0:
      counter += 1
  
  if counter == 8:
    ans += 1
    
print(ans)

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

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

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

    for k in range(1,j):
        if i % k==0:

            cnt+=1

            if cnt>8:
                break
    
    if cnt == 8:
        result+=1
    
print(result)

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(n+1):
  if i%2 != 0:
    y = make_divisors(i)
    if len(y) == 8:
      count+=1
print(count)

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

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

Solution (Python):
def main():
    N = int(input())
    cnt = 0
    for i in range(1, N+1, 2):
        cnt_tmp = 0
        for j in range(1, N+1):
            if i % j == 0:
                cnt_tmp += 1
        if cnt_tmp == 8:
            cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()

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

res = 0
for i in range(1,N+1):
  if i%2==0: continue
  cnt = 0
  num = i
  for j in range(1, int(i**0.5)+1):
    if num%j==0:
      cnt += 1
      if j != num//j:
        cnt += 1

  if cnt == 8: 
    res += 1

print(res)

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

def count_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])


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

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

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

Solution (Python):
from collections import defaultdict

def prime(n): 
    dic = defaultdict(int)
    i=2
    while i*i<=n:
        while n%i==0:
            n//=i
            dic[i]+=1
        i+=1
    if n!=1: dic[n]=1
    return dict(dic)

n=int(input())
cnt=0
for i in range(1,n+1,2):
    res=prime(i)
    temp=1
    for val in res.values(): temp*=val+1
    if temp==8: cnt+=1
print(cnt)

Solution (Python):


def judge(k):
    c = 0
    _k = round(k**(1/2))
    for i in range(_k-1):
        if k % (i+1) == 0:
            c += 2
    if k % _k == 0:
        c += 1
    return c == 8 and k % 2

def solve(n):
    c = 0
    for i in range(n):
        if judge(i+1):
            c += 1
    return c


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


if __name__ == '__main__':
    main()

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)

    divisors.sort()
    return divisors
a=int(input())
b=0
for i in range(1,a+1,2):
    if len(make_divisors(i))==8:
        b+=1
print(b)

Solution (Python):
n = int(input())
output = 0
for num in range(1, n+1, 2):
    count = 0
    for divisor in range(1, num+1):
        if num % divisor == 0:
            count += 1
    if count == 8:
        output += 1
print(output)

Solution (Python):
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass


N = int(input())

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

print(count)

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

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

Solution (Python):
def div(n):
    if n==1:s=1
    else:s=2
    for i in range(2,n):
        if n%i==0:s+=1
    return s

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

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

def dv(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 = i()
ans = 0
for i in range(1,N+1,2):
    if len(dv(i)) == 8:
        ans += 1
print(ans)

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

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

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