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:
N = int(input())

cnt=0
ans=0

for i in range(1,N+1,2):#iは対象となる奇数
    for j in range(1,i+1):
        if i%j ==0:
            cnt+=1
    if cnt ==8:
        ans+=1
    cnt =0

print(ans)

Submission status: Accepted

Solution code:

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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
# import sympy

# 約数計算


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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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(i)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

def prime(n): #O(√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)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - 105

def yakusu_rekkyo(n):
    yakusu = set()
    for i in range(1, int(pow(n, 0.5)+1)):
        if n%i == 0:
            yakusu.add(i)
            yakusu.add(n//i)
    return yakusu

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

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())

def f(n):
    ans = 1
    for i in range(2, n + 1):
        if n % i == 0:
            ans += 1
    return ans


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

Submission status: Accepted

Solution code:
def actual(N):
    answer = 0

    odd_numbers = range(1, N + 1, 2)

    is_divisor = lambda num, i: num % i == 0

    for odd_num in odd_numbers:
        divisor_count = 0

        for i in range(1, odd_num + 1):
            if is_divisor(odd_num, i):
                divisor_count += 1

        if divisor_count == 8:
            answer += 1

    return answer

N = int(input())
print(actual(N))

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())

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

        if c == 8:
            cnt += 1

print(cnt)

Submission status: Accepted

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

for i in range(n + 1)[1::2]:
    c = 0
    j = i
    k = i
    while j > 0:
        if k % j == 0:
            c += 1
        j -= 1
    if c >= 8:
        p += 1

print(p)

Submission status: Accepted

Solution code:
n=int(input())
if 104>=n:
  print(0)
elif 105<=n<=134:
  print(1)
elif 135<=n<=164:
  print(2)
elif 165<=n<=188:
  print(3)
elif 189<=n<=194:
  print(4)
else:
  print(5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=[3,5,7,11,13]
ans=[0]*10000
for i in range(3):
    for j in range(i+1,4):
        for k in range(j+1,5):
            ans[l[i]*l[j]*l[k]]=1
ans[135]=1
ans[189]=1
print(sum(ans[:n+1]))

Submission status: Accepted

Solution code:
def have_eight_divisor_odd(n):
    have_eight_divisor_odd_count = 0
    for i in range(1, n+1):
        count = 0
        if i % 2 == 1:
            for j in range(1, i+1):
                if i % j == 0:
                    count += 1
        if count == 8:
            have_eight_divisor_odd_count += 1
    return have_eight_divisor_odd_count

N = int(input())
result = have_eight_divisor_odd(N)
print(result)

Submission status: Accepted

Solution code:
n = int(input())

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

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)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
if n < 105:
  print(0)
else:
  output = 0
  for i in range(105,n+1):
    if i % 2 == 0:
      continue
    yaku = 0
    for j in range(1,i+1):
      if i % j == 0:
        yaku += 1
      if yaku > 8:
        continue
    if yaku == 8:
      output += 1
  print(output)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    d = 0
    for i in range(1, n + 1, 2):
        c = 2
        for j in range(3, i // 2 + 1):
            if i % j == 0:
                c += 1
            if c > 8:
                break

        if c == 8:
            d += 1

    print(d)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
n = int(input())

if n == 1:
    print(0)

else:    
    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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=[]
for i in range(1,201):
    if i%2==0:
        l.append(0)
        continue
    c=0
    for j in range(1,i+1):
        if i%j==0:
            c+=1
    if c==8:
        l.append(1)
    else:
        l.append(0)
print(sum(l[:n]))

Submission status: Accepted

Solution code:
import math
N=int(input())
ans=0
for i in range(1,N+1,2):
    temp=0
    for j in range(1,math.floor(math.sqrt(i)+1)):
        if i%j==0:
            temp+=2
    if temp==8:
        ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def main():
    n = int(sys.stdin.readline())

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

    dp = [0] * 201
    ans = 0

    for i in range(1, n + 1):
        for j in range(105, n + 1):
            if j % i == 0:
                dp[j] += 1

    for i in range(105, n + 1, 2):
        if dp[i] >= 8:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

dp = [0] * 201
ans = 0

for i in range(1, n + 1):
    for j in range(105, n + 1):
        if j % i == 0:
            dp[j] += 1

for i in range(105, n + 1, 2):
    if dp[i] >= 8:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
class Factorization:	
	def __init__(self):
		# privateなインスタンス変数を作成
		self.__factors = dict()
		self.__n = 0
	
	
	def get_factors(self, n):
		# [summary] 素因数分解した結果を、辞書([素因数, 指数]...)で返す
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			# 2より小さい数の場合、素因数分解できない
			return { n:1 }
		else:
			self.__factorization()
			
			return self.__factors
	
	
	def get_divisors(self, n):
		# [summary] 約数をリストに列挙
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			return [1]
		else:
			self.__factorization()
			divisors = [1]
			
			for k, v in self.__factors.items():
				import copy
				copy_ = copy.deepcopy(divisors)
								
				for i in range(1, v + 1):
					for c in copy_:
						divisors.append(c * (k ** i))
			
			return divisors

				
	def count_divisors(self, n):
		# [summary] 約数の個数を返す
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			return 1
		else:
			self.__factorization()
			count = 1
			
			for v in self.__factors.values():
				count *= v + 1
			
			return count
	

	def	__factorization(self):
		# [summary]素因数分解した結果を、インスタンス変数に格納
		
		# 2,3,5で、割れなくなるまで割り続ける
		# (末尾に2,3,5のつく数は素数でないことが明白なので
		# 後続の処理で素数のリストに入れないように、先に処理する)
		self.__divide_with(2)
		self.__divide_with(3)
		self.__divide_with(5)
			
		# 平方根以下の素数で総当たりで試し割りする
		# (実際は、素数らしき数)
		import math
		sqrt_ = math.floor(math.sqrt(self.__n))
			
		primes = [7, 11, 13, 17, 19, 23, 29, 31]
		i = 0
		is_break = False
			
		while self.__n > 1:
			for p in primes:
				if p + i <= sqrt_:
					self.__divide_with(p + i)
				else:
					# 試し割りする数が平方根を超えたら、ループを抜ける
					is_break = True
						
					# 1が素因数に追加されることを防止
					if self.__n > 1:
						self.__factors.setdefault(self.__n, 1)
				
			if is_break:
				break
			else:
				i += 30
	
	
	def __divide_with(self, d):
		count = 0
		
		while self.__n % d == 0:
			self.__n //= d
			count += 1
		
		if count > 0:
			self.__factors.setdefault(d, count)


n = int(input())
lib = Factorization()
ans = 0

for i in range(1, n + 1, 2):
	divisors = lib.get_divisors(i)
	
	if len(divisors) == 8:
		ans += 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
if n<105:
  print(0)
  exit()
else:
  c=0
  for i in range(105,n+1,2):
    p=0
    for j in range(1,i//2+1,2):
      if i%j==0:
        p+=1
    if p==7:
      c+=1
print(c)

Submission status: Accepted

Solution code:
def main():
    ans = 0
    for i in range(1, int(input())+1, 2):
        c = 2 # 1とその数自身で+2
        for j in range(2, i // 2):
            if i % j == 0:
                c += 1
        #print(i, "->", c)
        if c == 8:
            ans += 1
    print(ans)
        
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
c= []
ans = 0
for i in range(1, n+1):
  if i % 2 == 1:
    c.append(i)


for i in c:
  if i == 1:
    continue
  else:
    t = 2
    for k in range(1, c.index(i) - 1):
      if i % c[k] == 0:
        t += 1

    if t == 8:
      ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

def make_divisors(n):
    from collections import deque
    divisors = deque([])
    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)
    lst_divisors = list(divisors)
    lst_divisors.sort()
    return lst_divisors

ans = 0
for i in range(1,-(-N//2)+1):
    now = 2*i-1
    if len(make_divisors(now)) == 8:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from itertools import combinations
import math


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()
ans = 0
if N >= 105:
    for i in range(105, N+1, 2):
        yakusu = 0
        for q in range(1, N+1):
            if i % q == 0:
                yakusu += 1
        if yakusu == 8:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
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==1:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans =[]
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.append(i)

print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(count)

Submission status: Accepted

Solution code:
n=int(input())

if n<105:
    print(0)
elif 105<=n and n<135:
    print(1)
elif 135<=n and n<165:
    print(2)
elif 165<=n and n<189:
    print(3)
elif 189<=n and n<195:
    print(4)
else:
    print(5)

Submission status: Accepted

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


print(flag)

Submission status: Accepted

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

ans=0

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

print(ans)

Submission status: Accepted

Solution code:
# 2 ABC106 B 105

def factorization(n):
    ret = []
    i = 2
    if n == 1:
        return ret
    while i ** 2 <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret
    
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

print(ans)

Submission status: Accepted

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


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

print(ans)

Submission status: Accepted

Solution code:
import sys
n = int(input())
if n <= 3:
    print(3)
    sys.exit()
def check(a):
    sqrt = round(a ** 0.5 + 0.5)
    factors = {1, a}
    for i in range(2, sqrt + 1):
        if not a % i:
            if not i in factors:
                factors.add(i)
            j = a // i
            if not j in factors:
                factors.add(j)
    return len(factors)
ans = 0
for i in range(3, n + 1, 2):
    if check(i) == 8:
        ans += 1
print(ans)

Submission status: Accepted

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