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):
mod = 10 ** 9 + 7
mod2 = 2 ** 61 + 1
from collections import deque
import heapq
import time
from bisect import bisect_left, insort_left, bisect_right
import sys
import random
import itertools

input = sys.stdin.readline
_NUMINT_ALL = list(range(10))
_START_TIME = time.time()


def main():
    ans = solve()

    if ans is True or ans is False:
        YesNo(ans)
    elif ans is not None:
        print(ans)


def solve():

    N = iip()[0]

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

        if ny == 8:
            
            ans += 1

    print(ans)









def kiriage_warizan(a, b):
    return -(-a//b)


def iip(listed=True):  
    d = input().rstrip("\n").split()
    try:
        ret = [int(i) for i in d]
    except:
        ret = [int(i) if i in _NUMINT_ALL else i for i in d]
        if len(ret) == 1 and listed is False:
            return ret[0]

    if len(ret) == 1 and not listed:
        return ret[0]
    return ret

def iipt(l, listed=True, num_only=True):  
    ret = []
    for i in range(l):
        ret.append(iip(listed=listed))
    return ret


def saidai_kouyakusuu(A):  
    l = len(A)
    while True:
        m = min(A)
        mx = max(A)
        if m == mx:
            return m

        for i in range(l):
            if A[i] % m == 0:
                A[i] = m
            else:
                A[i] %= m

def time_debug_10percent():
    a = random.randint(0, 9)
    if a == 9:
        sys.exit()

def time_debug(t):
    time.sleep(_START_TIME + t - time.time())
    sys.exit()


def make_graph_edge_flat(N):  
    ret = []
    for i in range(N-1):
        a, b, c = iip()
        a -= 1
        b -= 1
        ret[a].append((b, c))
        ret[b].append((a, c))
    return ret


def sort_tuples(l, index):  
    if isinstance(l, list):
        l.sort(key=lambda x: x[index])
        return l
    else:
        l = list(l)
        return sorted(l, key=lambda x: x[index])


def count_elements(l):  
    d = {}
    for i in l:
        if i in d:
            d[i] += 1
        else:
            d[i] = 1
    return d


def safeget(l, index, default="exception"):  
    if index >= len(l):                      
        if default == "exception":
            raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。配列の長さは", len(l), "です"]))
        else:
            return default
    elif index < 0:
        if default == "exception":
            raise Exception("".join(["safegetに不正な値 ", index, "が渡されました。負の値は許可されていません"]))
        else:
            return default
    else:
        return l[index]


def sortstr(s):  
    return "".join(sorted(s))


def iip_ord(startcode="a"):  
    if isinstance(startcode, str):
        startcode = ord(startcode)
    return [ord(i) - startcode for i in input()]


def YesNo(s):  
    if s:
        print("Yes")
    else:
        print("No")


def fprint(s):  
    for i in s:
        print(i)


def bitall(N):  
    ret = []
    for i in range(2 ** N):
        a = []
        for j in range(N):
            a.append(i % 2)
            i //= 2
        ret.append(a)
    return ret

def split_print_space(s):  
    print(" ".join([str(i) for i in s]))


def split_print_enter(s):  
    print("\n".join([str(i) for i in s]))


def soinsuu_bunkai(n):  
    ret = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            n //= i
            ret.append(i)
        if i > n:
            break
    if n != 1:
        ret.append(n)
    return ret


def conbination(n, r, mod, test=False):  
    if n <= 0:
        return 0
    if r == 0:
        return 1
    if r < 0:
        return 0
    if r == 1:
        return n
    ret = 1
    for i in range(n - r + 1, n + 1):
        ret *= i
        ret = ret % mod

    bunbo = 1
    for i in range(1, r + 1):
        bunbo *= i
        bunbo = bunbo % mod

    ret = (ret * inv(bunbo, mod)) % mod
    if test:
        
        pass
    return ret


def inv(n, mod):  
    return power(n, mod - 2)


def power(n, p, mod_=mod):  
    if p == 0:
        return 1
    if p % 2 == 0:
        return (power(n, p // 2, mod_) ** 2) % mod_
    if p % 2 == 1:
        return (n * power(n, p - 1, mod_)) % mod_


def nibutan_func(func, target, left, right, side="left"): 
    l = left
    r = right
    x = (l + r) // 2
    while r-l > 1:
        x = (l+r)//2
        if func(x) == target:
            return x
        elif func(x) > target:
            r = x
        else:
            l = x

    if side == "left" or func(x) == target:
        return l
    else:
        return r


def nibutan_list(list_, target, side="left"):  
    if not isinstance(list_, list):
        list_ = list(list_)

    l = 0
    r = len(list_)
    x = (l + r) // 2
    while r-l > 1:
        x = (l+r)//2
        if list_[x] == target:
            return x
        elif list_[x] > target:
            r = x
        else:
            l = x

    if side == "left" or list_[x] == target:
        return l
    else:
        return r


class UfTree():
    def __init__(self, maxnum):
        self.parent = list(range(maxnum))
        self._size = [1] * maxnum
        self.rank = [0] * maxnum

    def size(self, a):
        return self._size[self.root(a)]

    def root(self, a):
        rank = 0
        cur = a
        while True:
            if self.parent[cur] == cur:
                
                
                return cur
            else:
                self.parent[cur] = self.parent[self.parent[cur]]
                cur = self.parent[cur]
                rank += 1

    def unite(self, a, b):
        ra = self.root(a)
        rb = self.root(b)
        if ra == rb:
            return self

        self._size[ra] += self._size[rb]
        self.parent[rb] = ra
        return self

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
q = []
for i in range(0,-(-N//2)+1):
    p = []
    for j in range(1,N+1):
        if (2*i-1) % j == 0:
            p.append(j)
    if len(p) == 8:
        q.append(1)
print(len(q))

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

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

print(ans)

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

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

print(ans)

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

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

        if div_count == 8:
            answer += 1

print(answer)

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

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

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

Solution (Python):


import collections


def solve():

    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)


if __name__ == "__main__":
    solve()

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

ans = 0
for i in range(1, N+1):
    if i%2 != 0:
        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 math

def countPrimeNum(n):
  count = 0
  max = math.ceil(math.sqrt(n)) + 1
  for i in range(1, max):
    if n % i == 0:
      if n / i == i:
        count = count + 1
      else:
        count = count + 2
  return count

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

print(count)

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

Solution (Python):
N = int(input())
def prime(n,p):
  cnt = 0
  while n%p == 0:
    n //= p
    cnt += 1
  return cnt,n
ans = 0
for i in range(1,N+1,2):
  tmp = 1
  t = i
  for p in range(2,i):
    num,t = prime(t,p)
    tmp *= (num+1)
  if tmp == 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:
        ans += 1

print(ans)

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

n = int(input())

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

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

print(res)

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

Solution (Python):
n = int(input())
ans = 0
def ok(x):
    res = 0
    i = 1
    while i*i <= x:
        if x%i == 0:
            res+=1
            if i!=x//i:res+=1
        i+=1
        
    return res == 8
for i in range(1,n+1,2):
    ans+=ok(i)
print(ans)

Solution (Python):
t = 0

def div(n):
    c = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            c += 2 if i != n // i else 1
    return c

for i in range(1, int(input()) + 1, 2):
    if div(i) == 8:
        t += 1

print(t)

Solution (Python):

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

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

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

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

    return cnt

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

print(cnt)

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

def prime_factorization(n):
    originaln = n
    result = []
    f = 2
    while f*f <= originaln+10:
        a = 0
        while n%f ==0:
            n = n//f
            a = a+1
            
        if a!=0:
            
            result.append(a)
        f = f+1
    
    ans = 1
    for i in result:
        ans *= (i+1)
    
    if ans == 8:
        return True
    else:
        return False

finalans = 0
for i in range(2,N+1):
    if prime_factorization(i) == True and i%2 == 1:
        
        finalans +=1
print(finalans)

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

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

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

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

for i in range(1,n+1,2):
    if i > 200:
        break
    
    if len(make_divisors(i)) == 8:
        result += 1
    

print(result)

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

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

def yak(n):
  lis = []
  for i in range(1,n+1):
    if n%i==0: lis.append(i)
  return lis

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

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

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

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

ans = 0

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

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

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

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

print(count)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

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

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

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

def factorize(x):
    results = []
    for i in range(1, x+1):
        if i*i == x:
            results.append(i)
            break
        if i*i > x:
            break
        else:
            if x % i == 0:
                results.append(i)
                results.append(x // i)
    return results

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

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

solution()

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

Solution (Python):
n = int(input())
count = 0
for z in range(1,n+1):
	if not z%2 or z <= 104:
		continue
	y = 0
	for i in range(1,z+1):
		if z%i == 0:
			y += 1	
	if y == 8:
		count += 1
print(count)

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 len(divisors)
  
ans = 0

for i in range(1,N+1):
  a = make_divisors(i)
  if a ==8 and i%2 == 1 :
    ans += 1
    
print(int(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 len(divisors)

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

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

Solution (Python):
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):
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)


n = int(input())
ans = 0
for i in range(1, n + 1, 2):
    cnt = 0
    d = 1
    while d <= i:
        if i % d == 0:
            cnt += 1
        d += 1
    if cnt == 8:
        ans += 1
print(ans)

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


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


if __name__ == '__main__':
    s = int(input())
    ans =0

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

        if count ==8:
            ans +=1

    print(ans)

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

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

print(ans)

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  n = int(input())
  ans = 0
  cnt = 0
  
  for i in range(1,n+1,2):
    ans = 0
    for j in range(1,i+1):
      if i%j == 0:
        ans+=1
    if ans == 8:
      cnt += 1
  print(cnt)
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)

    
    return len(divisors)

def Yakusu(n):

    ans = 0

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

    return ans

def main():
    n = int(input())
    print(Yakusu(n))

if __name__ == '__main__':
    main()

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

for i in range(1,N+1):
    li= []
    for j in range(1,i+1):
        if i % j == 0 and(i%2 != 0):
            li.append(i)
        else:pass
    if len(li) == 8:ans+=1
print(ans)

Solution (Python):
def getyakusu(V):
    if V%2==0:
        return 0
    c=0
    for i in range(1,V+1):
        if V % i ==0:
            c+=1
    return 1 if c==8 else 0


def resolve():
    N=int(input())
    print(sum(map(getyakusu,range(1,N+1))))


if __name__ == "__main__":
    resolve()

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

N = int(input())
ans = 0
for i in range(1, N + 1):
    if i % 2 == 1:
        if len(make_divisors(i)) == 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):
N = int(input())
Ans = 0

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

print(Ans)

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

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

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


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


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

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

answer=0
count=0
 
for i in range(1,N+1,2):
    for j in range(1,int(i**0.5)+1):
        if i%j==0:
            count+=1
    if count==4:
        answer+=1
    count=0
 
print(answer)

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

Solution (Python):
n=int(input())
l=list(range(1,n+1))
k=[105,135,165,189,195]
lk=set(l) & set(ｋ)
print(len(lk))

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())
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
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

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

print(cnt)

Solution (Python):
n = int(input())
res = 0
for a in range(1, n + 1)[::2]:
  i = 1
  s = set()
  while i * i <= a:
    if a%i == 0:
      s.add(i)
      s.add(a//i)
    i += 1
  if len(s) == 8:
    res += 1
print(res)

Solution (Python):
import sys

def resolve():
    N = int(input())
    cnt = 0
    for i in range(1, N+1, 2):
        if is_8_factors(i):
            cnt += 1
    print(cnt)

def is_8_factors(n):
    nfactors = 2
    upper = n
    div = 3
    while True:
        if upper <= div:
            break
        if n % div == 0:
            nfactors += 2
            upper = n // div
        div += 2

    return True if nfactors == 8 else False

if '__main__' == __name__:
    resolve()

Solution (Python):

N=int(input())
ans=0

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

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

Solution (Python):
N = int(input())
def yakusuu(a):
    b = 0
    if a % 2 == 1:
        for i in range(1,a+1):
            if a % i == 0:
                b += 1
        return b
    else:
        return 0
ans = 0
for i in range(1,N+1):
    if yakusuu(i) == 8:
        ans += 1
print(ans)

Solution (Python):
import math
def yakusuu(a):
  x=[]
  b=math.ceil(math.sqrt(a))
  for i in  range(1,b+1):
    if a%i==0:
      x.append((i,int(a/i)))
  return(x)
N=int(input())
oddlist=[i for i in range(1,N+1,2)]
ans=[]
for i in oddlist:
  x=yakusuu(i)
  if len(x)==4:
    ans.append(i)
print(len(ans))

Solution (Python):
from math import sqrt

N = int(input())

def div_count(n):
    count = 0
    for i in range(1,int(sqrt(n))+1):
        if n % i == 0:
            count += 2
    if n == int(sqrt(n))**2:
        count -= 1
    return count

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

print(ans)

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

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

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

        temp+=1
print(temp)

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

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

print(len(total))

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

def cnt_divisors(n):
    divisor=[]
    for i in range(1,int(n**0.5)+1):
        if n%i ==0:
            divisor.append(i)
            if i != n//i:
                divisor.append(n//i)
    return len(divisor)
    
for i in range(1,n+1,2):
    if cnt_divisors(i)==8:
        ans+=1
        
print(ans)

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

answer=0

for n in range(1,N+1,2):
    count=0
    for i in range(1,int(pow(n,1/2))+1):
        if n%i==0:
            if n//i!=i:
                count+=2
            else:
                count+=1
    if count==8:
        answer+=1

print(answer)

Solution (Python):

import sys


def solve(N: int):
    cnt = 0
    for i in range(1, N+1, 2):
        if len(make_divisors(i)) == 8:
            cnt += 1
    print(cnt)
    return


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



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
yakusuu8 = [135,189,105,165,195]
ans = 0

for i in range(1,n+1):
    if i in yakusuu8:
        ans += 1
        
print(ans)

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

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

print(ans)

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

while i <= n:
    yakusuu = 0

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

    if yakusuu == 8:
        ans = ans + 1

    i = i + 2

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

print(ans)

Solution (Python):

"""
Created on Tue Mar 31 09:15:46 2020

@author: black
"""
def check(x):
    div = [1]
    for j in range(1, x):
        if (x)%(j+1) == 0:
            div.extend([j+1])
    return len(div)




N = int(input())
ans = []

for x in range(1, N+1):
    if x%2 == 1:
        if check(x) == 8:
            ans.extend([x])


print(len(ans))

Solution (Python):

"""
Created on Tue Mar 31 02:12:27 2020

@author: liang
"""

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

Solution (Python):
def solve():
    n = int(input())
    ans = 0
    for i in range(1,n+1):
        if i%2==0:
            continue
        d = 0
        for j in range(1,i+1):
            if i%j==0:
                d+=1
        if d==8:
            ans+=1
    print(ans)
if __name__ == "__main__":
    solve()

Solution (Python):

"""
Created on Tue Mar 31 02:12:27 2020

@author: liang
"""

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

Solution (Python):
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

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