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.



Sample input:
105


Sample output:
1

Submission status: Accepted

Solution code:
a = int(input())

if a>=3*5*13:
    print(5)
elif a>=27*7:
    print(4)
elif a>=3*5*11:
    print(3)
elif a>=135:
    print(2)
elif a>=105:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
N = int(input())
def get(n, item):
    i = 0
    while n%item==0:
        n = n/item
        i += 1
    return i
def get2(n):
    l = []
    target = [3,5,7,11,13]
    for item in target:
        l.append(get(n,item))
        if not l: continue
    m = 1
    for item in l:
        m *= (item+1)
    if m == 8:
        return 1
    else:
        return 0

out = 0
for n in range(105, N+1, 2):
    tmp = get2(n)
    out += tmp
#     if tmp: print(n)
print(out)

Submission status: Accepted

Solution code:
l = input().split()
A = int(l[0])

ans = 0
if A > 105 - 1:
    ans = ans + 1

if A > 135 - 1:
    ans = ans + 1

if A > 165 - 1:
    ans = ans + 1

if A > 189 - 1:
    ans = ans + 1

if A > 195 - 1:
    ans = ans + 1


print(ans)

Submission status: Accepted

Solution code:
N = int(input())
if (N&1)==0: ans = 0
if   N<3*5* 7: ans = 0
elif N<3*5* 9: ans = 1
elif N<3*5*11: ans = 2
elif N<3*7* 9: ans = 3
elif N<3*5*13: ans = 4
else:          ans = 5
print(ans)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
def make_divisor(n):
    table = [0] * (n + 1)
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    return table

n = int(input())
t = make_divisor(n)
print(len([1 for i in range(1, n + 1) if i & 1 and t[i] == 8]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
# A, B = map(int, input().split())
# A = list(map(int, input().split()))
# d = [list(map(int, input().split())) for _ in range(N)]
# s = input()

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

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
t=0
for i in range(1,N+1,2):
    s=0
    for j in range(1,i+1,2):
        if i%j==0:
            s+=1
    if s==8:
        t+=1
print(t)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

n = int(input())

def judge(x):
    ret = 1
    for i in range(1,x):
        if x%i==0:
            ret += 1
    return ret

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

Submission status: Accepted

Solution code:
N = int(input())
anslist = [105, 165, 195, 135, 189]
print(len([i for i in anslist if i <= N]))

Submission status: Accepted

Solution code:

#encoding utf-8

n = int(input())

count = 0
if n >= 105:
    count += 1
if n >= 135:
    count += 1
if n >= 165:
    count += 1
if n >= 189:
    count += 1
if n >= 195:
    count += 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
if N<=104:
    print(0)
elif N<=134:
    print(1)
elif N<=164:
    print(2)
elif N<=188:
    print(3)
elif N<=194:
    print(4)
else:
    print(5)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve():
    n = int(input())
    if n < 105:
        print(0)
        return

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
N = int(input())


# 約数の計算
def count_yakusuu(n):
    c = 0
    for j in range(1, n+1):
        if n % j == 0:
            #print("n % j ==0", n, j)
            c += 1
    return c


cnt = 0
for i in range(1,N+1,2):
    c = count_yakusuu(i)
    #print("i,c:",i,c)
    if count_yakusuu(i) == 8:
        #print(i, "is 8")
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

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

    if count == 8:
        # print('n=',n)
        # print('i=',i)
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())						# 5


ans=0
for j in range(1,N+1, 2):
	count=0
	for i in range(1, j+1):
		if (j/i)==(j//i):
			count+=1
	else:
		if(count==8): 
			ans+=1
#			print(j, end=',')
#print()
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
import math
n = int(input())

def primelist(num):
    if num < 2:
        return []

    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def prime_factorization(num):
    if num <= 1:
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = primelist(num_sqrt)

        dict_counter = defaultdict(int)
        for prime in prime_list:
            while num % prime == 0:
                dict_counter[prime] += 1
                num //= prime
        if num != 1:
            dict_counter[num] += 1

        dict_counter = dict(dict_counter)

        return dict_counter

def search_divisor_num(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        divisor_num = 1
        dict_fact = prime_factorization(num)
        for value in dict_fact.values():
            divisor_num *= (value + 1)
        return divisor_num

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

exit(0)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect


N = int(input())
ans = 0
if N < 105:
    print(0)
    exit()

num = N

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
total_number = 0
n = 0
while 2*n+1 <=N:
    yakusuu = 1
    yakusuu_number = 0
    while yakusuu <=2*n+1:
        if (2*n+1) % yakusuu ==0:
            yakusuu_number += 1
        yakusuu += 1
    n += 1
    if yakusuu_number == 8:
        total_number += 1
print(total_number)

Submission status: Accepted

Solution code:
a=int(input())
if a < 105:
    print("0")
else:
    count=1
    for i in range(107, a+1, 2):
        now=i
        count8=0
        for j in range(1, 200):
            if now % j == 0:
                count8+=1
        if count8==8:
            count+=1
    print(count)

Submission status: Accepted

Solution code:
N = int(input())
count = 0

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

	while(j<=i):
		j += 1
		if(i%j==0):

			yakusuu += 1

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

Submission status: Accepted

Solution code:
def numOfYaku(arg):
    ret = 0
    for i in range(1, arg + 1):
        if arg % i == 0:
            ret += 1
    return ret

a = int(input())
ans = 0
for j in range(1, a + 1):
    if numOfYaku(j) == 8 and j % 2 ==1 : ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
c = 1
count = 0

for i in range(1,N+1,2):
    for j in range(1,int((i-1)/2)):
        if i%j == 0:
            c += 1
    if c == 8:
        count += 1
    c = 1
print(count)

Submission status: Accepted

Solution code:
import math

n = int(input())

if n < 105:
    ans = 0
else:
    ans = 0
    for i in range(105,n+1,2):
        cnt = 0
        for j in range(1,int(math.sqrt(i))+1):
            if i % j == 0:
                #print(j)
                cnt += 2
        if cnt == 8:
            ans += 1
            #print(i)

print(ans)

Submission status: Accepted

Solution code:
import math, string, fractions, heapq, re, array, bisect, sys, random, time, copy
import itertools as it
import operator as op
import collections as cl
import functools as ft

def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x) - 1, input().split()))
def LF(): return list(map(float, input().split()))
def LS(): return input().split()
def I(): return int(input())
def F(): return float(input())
def S(): return input()


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def count_divisor(fct):
    counts_plus1 = [count+1 for _, count in fct]
    total = ft.reduce(op.mul, counts_plus1)

    return total


if __name__ == '__main__':
    n = I()
    count_8 = 0
    for i in range(3, n+1, 2):
        fct = factorize(i)
        if count_divisor(fct) == 8:
            count_8 += 1

    print(count_8)

Submission status: Accepted

Solution code:
# 105, 135, 165, 189, 195

n = int(input())
ans = 0

if n >= 105: #3 5 7
    ans+=1
if n >= 135: # 3 3 3 5
    ans+=1
if n >= 165: # 3 5 11
    ans+=1
if n >= 189: # 3 3 3 7
    ans+=1
if n >= 195: # 3 5 13
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
A=int(input())

answer=0
if A<=104:
  print(0)
  exit()
else:
  for i in range(105,A+1,2):
    count=0
    for j in range(1,i+1):
      if i%j==0:
        count+=1
    if count==8:
      answer+=1
print(answer)

Submission status: Accepted

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

count = 0
ans  = 0

for i in [x for x in range(n+1) if x % 2 != 0]:
    # print(i)
    count = 0
    for j in range(n):
        if i % (j+1) == 0:
            # print(j+1)
            count += 1
    # print(count)
    if count == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import logging
import time


class Solver:
    def __init__(self):
        self.n = 0

    # 入力
    def input_value(self):
        # self.n = int(input())
        # self.A, self.B = map(int, input().split())
        # self.A = list(map(int, input().split()))
        # self.a, self.b, self.c = map(int, [input() for i in range(4)])
        # self.t = [None] * self.n
        self.n = int(input())

    @staticmethod
    def calc_count(m):
        result = 1
        if m % 2 == 0:
            return 0
        for i in range(3, m + 1):
            if m % i == 0:
                result += 1
        return result

    @staticmethod
    def run(n):
        count = 0
        for i in range(1, n + 1, 2):
            if Solver.calc_count(i) == 8:
                count += 1
                # logging.debug(str(i))
        return count

    @staticmethod
    def test():
        start_time = time.time()

        assert Solver.calc_count(105) == 8, 'Error.'

        elapsed_time = time.time() - start_time
        logging.debug('elapsed_time: {0}'.format(elapsed_time) + '[sec]')


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    solver = Solver()
    # Solver.test()

    solver.input_value()
    ans = solver.run(solver.n)
    print(str(ans))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

num = 0
for i in range(1, N+1):
    divisors = {}
    if i % 2 == 0:
        continue
    for j in range(3, i+1):
        if j % 2 == 0:
            continue
        if i % j == 0:
            if j in divisors.keys():
                divisors[j] += 1
            else:
                divisors[j] = 1
    if sum(divisors.values()) + 1 == 8:
        num += 1

print(num)

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
def f(n):
    if n % 2 == 0:
        return False
    
    dic = {}
    res = 2
    for i in range(3, n//2 + 1):
        if n % i == 0:
            res += 1
    return res == 8

N = int(input())
if N < 105:
    print(0)
else:
    res = 0
    for n in range(105, N + 1):
        if(f(n)):
            res += 1
    print(res)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for x in range(105, N+1, 2):
    cnt = 1
    for y in range(2, x+1):
        if x % y == 0:
            c = 0
            while x % y == 0:
                c += 1
                x //= y
            cnt *= c+1
    if cnt == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())

def make_prime_list(num):
  if num < 2:
        return []

  prime_list = [i for i in range(num + 1)]
  prime_list[1] = 0
  num_sqrt = math.sqrt(num)

  for prime in prime_list:
    if prime == 0:
      continue
    if prime > num_sqrt:
      break

    for non_prime in range(2 * prime, num, prime):
      prime_list[non_prime] = 0

  return [prime for prime in prime_list if prime != 0]

def search_divisor_num(num):
  if num < 0:
    return None
  elif num == 1:
    return 1
  else:
    num_sqrt = math.floor(math.sqrt(num))
    prime_list = make_prime_list(num_sqrt)

    divisor_num = 1
    for prime in prime_list:
      count = 1
      while num % prime == 0:
        num //= prime
        count += 1
      divisor_num *= count

    if num != 1:
      divisor_num *= 2

    return divisor_num

i = 1
result = 0

while i <= n:
  divisor_count = search_divisor_num(i)
  if divisor_count == 8:
    result += 1
  i += 2

print(result)

Submission status: Accepted

Solution code:
n=int(input())

if n<105:
  print(0)
else:
  lst=[]
  
  for i in range(105,n+1):
    counter = 1
    if i % 2 == 1:
      for j in range(2, i+1):
        if i % j == 0:
          counter += 1
        if counter > 8:
          break
      if counter == 8:
        lst.append(i)
  print(len(lst))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for n in range(1, N+1):
    if n % 2 == 0:
        continue
    elif n < 105:
        continue
    count = 0
    for j in range(1, n+1):
        if n % j == 0:
            count += 1
            if count >= 9:
                break
    if count == 8:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

if N >= 195:
    print(5)
elif N >= 189:
    print(4)
elif N >= 165:
    print(3)
elif N >= 135:
    print(2)
elif N >= 105:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
B = raw_input()
A = int(B)

if A < 105:
  print 0
  
elif 104 < A < 135:
  print 1

elif 134 < A < 165:
  print 2

elif 164 < A < 189:
  print 3

elif 188 < A < 195:
  print 4
  
elif 194 < A:
  print 5

Submission status: Accepted

Solution code:
n = int(input())
s = [105, 135, 165, 189, 195]

cnt = 0

for i in range(n + 1):
    if i in s:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
a=[3**3*5,3**3*7,3*5*7,3*5*11,3*5*13]
a.sort()
n= int(input())
for i in range(len(a)):
    if a[i]>n:break
    if i==4:i=5
print(i)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
n_max = int(input())

num_ans = 0
for n in list(range(1,n_max+1,2)):
    n_ori = n
    yaku = []
    for k in range(3,100):
        if n%k == 0:
            n = n/k
            yaku.append(k)

    ans = 2**len(yaku)
    waru = [yaku.count(y) for y in yaku]
    for w in waru:
        ans/=w
    if ans == 8:
        num_ans += 1
#     print(n_ori,ans)
print(num_ans)

Submission status: Accepted

Solution code:
a = int(input())
b = 0
for i in range(a):
    cnt = 0
    if (i+1)%2 != 0:
        for j in range(i+1):
            if (i+1)%(j+1) == 0:
                cnt +=1
        if cnt == 8:
            b +=1
print(b)

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
def sieve(n):
    """
    Sieve of Eratosthenes
    """
    s = [True for _ in range(n + 1)]
    for i in range(2, int(n ** 0.5) + 1):
        if s[i]:
            for j in range(i * 2, len(s), i):
                s[j] = False
    return (i for i in range(n + 1) if s[i] and i > 1)


def main():
    n = int(input())
    primes = sieve(n)
    c = 0
    for i in range(1, n + 1, 2):
        if i in primes:
            continue
        cp = 0
        for j in range(1, i + 1):
            if i % j == 0:
                cp += 1
        if cp == 8:
            c += 1
    print(c)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

A = 1
res = 0
count = 0


while(1):
  for a in range(A):
    if A % (a+1) == 0:
      count+=1
      
  if count == 8:
    res+=1
  count = 0
  A+=2
  if A > N:
    break

print(res)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())

count = 0
if N < 105:
    pass
else:
    for i in range(105, N+1):
        if i % 2 == 0:
            pass
        else:
            divisor = 0
            for j in range(1, i+1):
                if i % j == 0:
                    divisor += 1
            if divisor == 8:
                count += 1
print(count)

Submission status: Accepted

Solution code:
a = int(input())
v = [105, 135, 165, 189, 195]
frag = 1
for i in range(5):
    if v[i] > a:
        print(i)
        frag = 0
        break
if frag == 1:
    print(5)

Submission status: Accepted

Solution code:
def run(n):
    if n < 105:
        return 0
    elif n < 135:
        return 1
    elif n < 165:
        return 2
    elif n < 189:
        return 3
    elif n < 195:
        return 4
    else:
        return 5


def read_line():
    n = int(input())
    return n


def main():
    n = read_line()
    print(run(n))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def yakusu_count_is_8(n):
    count = 0
    for i in range(1, n+1):
        if n % i == 0:
            count += 1
    if count == 8:
        return True
    else:
        return False

N = int(input())

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

Submission status: Accepted

Solution code:
N=int(input())
res = 0
for k in range(1,N+1):
    c = 0
    for i in range(1,k+1):
        if k%i == 0:
            c += 1
        else:
            pass
    if k%2 == 1 and c == 8:
        res += 1
    else:
        pass
print(res)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

if N < 105:
    print(0)
elif N == 105:
    print(1)
else:
    num = np.array([i for i in range(105, N+1, 2)])
    count = np.zeros(len(num))

    for i in range(1, N+1):
        mask = num % i == 0
        count += mask

    print(list(count).count(8))

Submission status: Accepted

Solution code:
N = int(input())

# 105, 135, 165, 189, 195
def N_checker(num):
    return 1 if N >= num else 0

res = 0
for i in [105, 135, 165, 189, 195]:
    res += N_checker(i)

print(res)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
a=[105,135,165,189,195]
N=int(input())
ans=0
for i in range(N+1):
    ans += int(i in a)
print(ans)

Submission status: Accepted

Solution code:
#B
N=int(input())
a=[105,135,165,189,195]
s=0
for i in a:
    if i<=N:
        s+=1
    else:
        break
print(s)

Submission status: Accepted

Solution code:
a = int(input())

if a >= 195:
    print("5")
elif a >= 189:
    print("4")
elif a >= 165:
    print("3")
elif a >= 135:
    print("2")
elif a >= 105:
    print("1")
else:
    print("0")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

a = 3*3*3*5
b = 3*3*3*7

m = 0

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

for f in range(5):
    for g in range(f+1, 5):
        for h in range(g+1, 5):
            if l[f]*l[g]*l[h] <= n:
                m += 1
        
if n>=a:
    m += 1
    if n>=b:
        m+= 1
        
print(m)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
if N <= 7:
	print(ans)
else:
	for i in range(8, N + 1):
		temp = 0
		for j in range(1, N + 1):
			if i % 2 == 1 and i % j == 0:
				temp += 1
		if temp == 8:
			ans += 1
	print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = int(input())

if(A<105):
    print(0);
elif(A<135):
    print(1);
elif(A<165):
    print(2);
elif(A<189):
    print(3);
elif(A<195):
    print(4);
else:
    print(5);

Submission status: Accepted

Solution code:
N = int(input())

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

#calc_deviser(105)

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()

N=ni()

def yaku(num):
  i = 0
  for j in range(num//2):
    if num%(j+1) ==0:
      i+=1
  return i+1

if N<105:
  print(0)
elif N==105:
  print(1)
else:
  ans = 1
  for i in range(107,N+1,2):
    if yaku(i) == 8:
      ans+=1
  print(ans)

Submission status: Accepted

Solution code:
N = int(input())
odds = [o for o in range(N+1) if o % 2 == 1]

count = 0
for o in odds:
    yaku = []
    for r in [r for r in odds if r <= o]:
        if o % r == 0:
            yaku.append(1)
    
    if (len(yaku)) == 8:
        count += 1

print(count)

Submission status: Accepted

Solution code:
data = int(input())

cnt = 0
for lop in range(1,data+1,2):
    buf = lop
    cnt2 = 0
    for lop2 in range(1,lop+1):
        if buf%lop2 == 0:
            cnt2 = cnt2 +1
        elif buf == 1:
            break
    if cnt2 == 8:
        cnt = cnt + 1
            
print(cnt)

Submission status: Accepted

Solution code:
a = int(input())


if a <= 104:
    print(0)
elif a >= 105 and a< 135:
    print(1)

elif a>= 135 and a< 165:
    print(2)
elif a>= 165 and a< 189:
    print(3)
elif a>= 189 and a < 195:
    print(4)
elif a<= 200:
    print(5)

Submission status: Accepted

Solution code:
n=int(input())
p=0
def f(n):
    a=0
    for i in range(2,n):
        if n%i==0:
            a+=1
    if a==6 and n%2==1:
        return True
    else:
        return False
        
if n<105:
    print(0)
else:
    for i in range(105,n+1):
        if f(i)==True:
            p+=1
    print(p)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

def f(n):
    r = []
    for d in range(1, n+1, 2):
        if n % d == 0:
            r.append(d)
    return r

def main(N):
    count = 0
    for i in range(1, N+1, 2):
        r = f(i)
        print(i, r, len(r), file=sys.stderr)
        if len(r) == 8:
            count+=1

    return count

    
n = int(input())
count = main(n)
print(count)

Submission status: Accepted

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


for i in range(1,N+1,2):
    divisor = 1
    for j in range(1, i//2 +1):
        if i % j == 0:
            divisor += 1
        if divisor > 8:
            break
    else:
        if divisor == 8:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
N=input()

ans=0

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

print ans

Submission status: Accepted

Solution code:
from math import sqrt, floor
A = int(input())
if A < 105:
  print("0")
  exit(0)

Q = 105
ans = 0

while Q <= A and Q <= 200: 
  cnt = 0
  i = 1
  while i <= sqrt(Q):
    if Q % i == 0:
      cnt += 1
    i += 2
    
  #print(Q,cnt)
  if cnt == 4:
    ans += 1
  Q += 2

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ps = [3, 5, 7, 11, 13]

ans = 0
for i in range(1, n + 1, 2):
    t = 1
    x = i
    for p in ps:
        cnt = 0
        while x % p == 0:
            x //= p
            cnt += 1
        t *= cnt + 1
    if t == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import bisect

n = int(input())
print(bisect.bisect([105, 135, 165, 189, 195], n))

Submission status: Accepted

Solution code:
n=int(input())
s=0
for i in range(105,n+1):
    c=0
    if i%2!=0:
        for j in range(1, i + 1):
            if i % j == 0:
                c+=1
    if c==8:
        s+=1
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
N=int(input())

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

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

def f(n):
  s=1
  t=0
  while s <= n:
    if n%s==0:
      t+=1
    s+=1
  return (t==8 and n%2==1)

S=1
T=0
while S<=n:
  T=T + (1 if f(S) else 0)
  S+=1
print(T)

Submission status: Accepted

Solution code:
N = int(input())

def Div(x):
    y = int(x ** 0.5)
    count = 0
    for i in range(1,y+1):
        if x % i == 0:
            count += 2
    if y**2 == x:
        count += 1
    return count

if N == 1:
    print(0)
    exit()

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:
from sys import stdin, stdout

input = lambda: stdin.readline()
write = stdout.write

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

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

main()