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

Solution (Python):

def divNum(x):
    tmp = set()
    i = 1
    while i < x**0.5:
        if x%i == 0:
            tmp.add(i)
            tmp.add(x//i) 
        i+=1
    return len(tmp)

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

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

ans = 0

def mkdivisors(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

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

ans = 0

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

print(ans)

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

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

print(ans)

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

b=0
for i in range(N):
  a=0
  for j in range(i+1):
   
    if a==9:
      b=b-1
      break
    if (i+1)%2!=0 and (i+1)%(j+1)==0:      
      a=a+1
    if a==8:
      b=b+1

print(b)

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

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n+1,2):
    p = set()
    for j in range(2, int(i**0.5+1)):
        if i % j == 0:
            p.add(j)
            p.add(i/j)
    if len(p) == 6:
        ans += 1
print(ans)

Solution (Python):




import sys
inf = 10**9+7
mod = 10**9+7


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

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

Solution (Python):
icase=0
if icase==0:
    def cd(nn):
        nnn=int(nn**0.5)+1
        cdl=set()
        for i in range(1,nnn):
            if nn%i==0:
                r=nn//i
                if not i in cdl:
                    cdl.add(i)
                if not r in cdl:
                    cdl.add(r)
        return len(cdl)            
            
    n=int(input())
    if n<105:
        print(0)
    elif n==105:
        print(1)
    else:
        icnt=1
        for nn in range(107,n+1,2):
            if cd(nn)==8:
                icnt+=1

        print(icnt)

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

Solution (Python):
N = int(input())
prime = [3,5,7,11,13] 
count = 0

for i in range(5):
    for j in range(i+1, 5):
        for k in range(j+1, 5):
            if prime[i]*prime[j]*prime[k] <=N:
                count += 1


for i in range(4):
    for j in range(i+1, 4):
        if prime[i]**3 * prime[j] <= N:
            count+= 1
        if prime[i] * prime[j]**3 <= N:
            count += 1
print(count)
"""
count = 0
for i in range(1,N+1,2):
    yakusuu = 0
    for j in range(1,i+1):
        if i%j == 0:
            yakusuu += 1
    if yakusuu == 8:
        print(i)
        count += 1
print(count)
"""

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

In = int(input())
count = 0
for i in range(1,In+1,2):
    if len(make_divisors(i))==8:
        count+=1

print(count)

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

i=1
ans=0
while i<=N:
    j=1
    count=0
    while j<=i:
        count+=1*(i%j==0)
        j+=1
    ans+=1*(count==8)
    i+=2

print(ans)

Solution (Python):




N = int(input())

Nlist = list(range(1,N+1, 2))
ans = 0
for n in Nlist:
    tmp = 1
    for i in range(1, (N+1)//2):
        if n % i == 0:
            tmp += 1
    if tmp == 8:
        ans += 1

print(ans)

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

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

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

    return arr





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

Solution (Python):

import io

data = int(input())
if data<105:
  print(0)
elif 104<data<135:
  print(1)
elif 134<data<165:
  print(2)
elif 164<data<189:
  print(3)
elif 188<data<195:
  print(4)
else:
  print(5)

Solution (Python):


from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    n = ii()
    cnt = 0
    for i in range(1,n+1):
        if not i%2:
            continue
        tmp = 0
        for j in range(1,i+1):
            if not i%j:
                tmp+=1
        if tmp == 8:
            cnt+=1
    print(cnt)


main()

Solution (Python):
n=int(input())
if n<105:
	print(0)
elif 105<=n<135:
	print(1)
elif 135<=n<165:
	print(2)
elif 165<=n<189:
	print(3)
elif 189<=n<195:
	print(4)
elif 195<=n:
	print(5)

Solution (Python):

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

cnt=0
i=1
n=int(input())
while i<=n:
	if make_divisors(i)==8:
		cnt+=1
	i+=2
print(cnt)

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

Solution (Python):
import math
"""
方針
nは１<= n <= 200なので、
あらかじめ200まで全探索 O(n*2*√n)
"""
def countyakusu(n):
    cnt = 0
    for i in range(1,int(math.sqrt(n))+1):
        if n%i == 0:
            cnt += 1
            if i != n//i:
                cnt += 1
    return cnt
result = [0]*200
for i in range(1,201):
    if i%2 != 0:
        result[i-1] = countyakusu(i)

n = int(input())
cnt = 0
for i in range(n):
    if result[i] == 8:cnt += 1
print(cnt)

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

Solution (Python):
def 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 divisors(i) == 8:
        cnt += 1
print(cnt)

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

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

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

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

Solution (Python):
def I(): return int(input())
N = I()
ans = 0
if N>=105:
    for i in range(105,N+1):
        yakusuu = []
        if i%2==1:
            for j in range(1,int(i**0.5)+1):
                if i%j==0:
                    yakusuu.append(j)
                    yakusuu.append(i//j)
        if len(yakusuu)==8:
            ans += 1
print(ans)

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

Solution (Python):
N = int(input())
count = 0
from math import sqrt
for i in range(1,N+1)[::-1]:
    if i%2==1:
        yakusu = 0
        for j in range(1,i+1):
            if i%j==0:
                yakusu += 1
        
        if yakusu == 8:
            count += 1
print(count)

Solution (Python):
n = int(input())
divisorcount8 = 0
for m in range(1, n + 1, 2):
  kcount = 0
  for k in range(1, m + 1, 2):
      if (m % k  == 0):
        kcount += 1
  if kcount == 8:
    divisorcount8 += 1
print(divisorcount8)

Solution (Python):
import sys

stdin = sys.stdin

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

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

def main():
    n = ni()
    ans = 0
    for i in range(1,n + 1):
        if i%2 == 1:
            if abc_b106(i):
                ans += 1
    print(ans)
    return

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 divisors

N = int(input())

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

print(ans)

Solution (Python):
N = int(input())
c = 0
for  i in range(1,N+1):
  if i % 2 == 0:
    continue
  li = []
  if i < 10:
    continue
  else:
    k = i
    for j in range(2,int(i**(0.5)+3)):
      d = 1
      while k % j == 0:
        k = k/j
        d += 1
      if d != 1:
        li.append(d)
    ss = 1
    for x in li:
      ss *= x
    if ss == 8:
      
      c += 1
    
print(c)

Solution (Python):

n = int(input())
num = 0

for i in range(1, n + 1, 2):
    divides = 0

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

    if divides == 8:
        num += 1

print(num)

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

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

def Y(num):
 cnt = 0
 for i in range(1,int(num**0.5+1)):
  if num % i == 0:
   cnt += 1
   if i != num**0.5:
    cnt += 1
 return cnt
            
res = 0
for i in range(n+1):
 if i%2 == 0:
  continue
 if Y(i) == 8:
  res += 1

print(res)

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

Solution (Python):
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

N = ni()

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(reverse=True)
    return divisors

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

print(ans)

Solution (Python):
N = int(input())
total = 0
for x in range(8,N+1):
  result = 0
  for y in range(1,(x//2)+1):
    if x%y == 0 and y%2==1:
      result += 1
  if result == 7:
    total += 1
print(total)

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

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

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

print(ans)

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

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

Solution (Python):
N = int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i ==0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

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

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

    return arr

c = 0
for i in range(2,N+1):
    if i%2 == 1:
        s = factorization(i)
        ans = 1
        for j in range(len(s)):
            ans *= (s[j][1] +1)
        if ans == 8:
            c += 1

print(c)

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

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

print(ans)

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


def divisors(n):
    divisors = []
    for i in range(1, n // 2 + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    return set(divisors)


c = 0
for i in range(1, N + 1):
    if len(divisors(i)) == 8 and i % 2:
        c += 1

print(c)

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

Solution (Python):
def countyaku(m):
    count = 0
    for i in range(1,m+1):
        if m%i==0:
            count += 1
    if count == 8:
        return True
    else:
        return False
n = int(input())
if n<105:
    print(0)
else:
    ans = 0
    for j in range(105,n+1,2):
        if countyaku(j):
            ans += 1
    print(ans)

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

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

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

print(ans)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

n = int(input())
ans = 0

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

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

print(count)

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

Solution (Python):
N = int(input())
def divisore(n):
    divisors=[]
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            divisors.append(i)
            if i!=n//i:
                divisors.append(n//i)
    divisors.sort(reverse=True)
    return divisors

ans = 0
for i in range(1,N+1):
    if i % 2 == 0:
        continue
    li = divisore(i)
    if len(li) == 8:
        ans +=1

print(ans)

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

for i in range(1,N+1):
  c = 0
  if i%2 == 0:
    continue
  for j in range(1,i+1):
    if i%j==0:
      c += 1
  if c == 8:
    c2 +=1
    
print(c2)

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

d = []
cnt = 0
for i in range(1,N+1):
    if i % 2 == 1:
        for j in range(1,int(i**0.5)+1):
            if i % j == 0:
                d.append(j)
                if j != i//j:
                    d.append(i//j)
        if len(d) == 8:
            cnt +=1
        d = []
print(cnt)

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

Solution (Python):
def wari(a,i):
    if(a%i == 0):
        return 1
    else:
        return 0

def yakusum(n):
    sum = 1
    for i in range(1,n//2):
        sum += wari(n,i)
    return sum


n = int(input())
sum = 0
for i in range(105,n+1,2):
    if yakusum(i) == 8:
        sum += 1

print(sum)

Solution (Python):
N = int(input())
count = 0
if 105 <= N <= 106:
  count = 1
elif N < 105:
  count = 0
else:
  count = 1
  for i in range(107, N + 1, 2):
    prime_count = 0
    for j in range(1, int(i ** (1/2)) + 1):
      if i % j == 0:
        prime_count += 1
        if i / j != j:
          prime_count += 1
    if prime_count == 8:
      count += 1
print(count)

Solution (Python):
N = int(input())
def divisor_all(n): 
    l = [1,n]
    for i in range(2,int(pow(n,1/2))+1):
        if n % i == 0:
            if i == n//i:
                l.append(i)
            else:
                l.append(i)
                l.append(n//i)
    l.sort()
    return l 
ans = 0
for i in range(1,N+1,2):
    if len(divisor_all(i))==8:
        ans += 1
print(ans)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

n = int(input())
make_divisors(n)
len(make_divisors(n))
ans = 0
ans_list = []

for i in range(1,n+1):
    if len(make_divisors(i)) == 8 and i % 2 == 1:
        ans += 1
        ans_list.append(i)

print(ans)

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

ans = 0

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

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

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

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

ans = 0

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

print(ans)

Solution (Python):
import numpy as np
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)

Solution (Python):
N=int(input())
s=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(N):
  if (i+1)%2!=0:
    if len(make_divisors(i+1))==8:
      s+=1
print(s)

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

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

Ans = 0
for i in range(1,N+1):
  if i % 2 == 1:
    c = 0
    for j in range(1,i+1):
      if i % j == 0:
        c +=1
    if c == 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, N+1):
        if (i%j==0):
            tmp += 1
    if(tmp == 8):
        ans += 1

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline 

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
            break
    

print(ans)

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

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

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

print(c)

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

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

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

def sum_up(num):
    cnt_n = 0
    for i in range(105, num+1, 2):
        tmp = 0
        for j in range(1, i+1):
            if(i%j == 0):
                tmp += 1
                if(tmp > 8):
                    break
        if(tmp == 8):
            cnt_n += 1
    return cnt_n
    
if(N < 105):
    print(0)
else:
    ans = sum_up(N)
    print(ans)

Solution (Python):


def div(x):
    a = []
    i = 1
    while i*i<x:
        if x%i == 0:
            a.append(x//i)
            a.append(i)
        i+=1
    n = len(a)
    return n 

def main():
    n = int(input())
    c = 0
    for i in range(1, n+1):
        if (i%2 != 0) and (div(i) == 8):
            c += 1
    print(c)
main()

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

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

print(ans)

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

n=int(input())
x=0
for i in range(n+1):
    if i%2==0:
        continue
    else:
        if yaku(i)==8:
            x+=1
print(x)

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

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

Solution (Python):

from decimal import *
from itertools import permutations, combinations,combinations_with_replacement,product
import math





N = int(input())




def yakusuu(n):
    
    l = []
    border = int(math.sqrt(n))
    
    for i in range(1, border+1):
        
        if(n % i == 0):
            l.append(i)
            l.append(int(n/i))
    if(l[-1] == l[-2]):
        del l[-1]
    return l

counter = 0
for i in range(1, N+1, 2):
    
    if(len(yakusuu(i)) == 8):
        counter += 1

print(counter)

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

for i in range(2, n + 1):
    div = 1
    while i * div <= n:
        dp[i * div] += 1
        div += 1

print(dp[1::2].count(8))

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

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

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

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


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

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

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

for j in range(a+1):
    count = 0
    for i in range(j+1):
        if i>=1:
            if j % i==0:
                count += 1
                
    if count == 8:
        
        if (j+1)%2==0:
            ans+=1

print(ans)

Solution (Python):
def has_eight_elements(n):
    if n%2 == 1 and sum([int(n%i==0) for i in range(1,n+1)]) == 8:
        return 1
    else:
        return 0
    
print(sum([has_eight_elements(x) for x in range(1,int(input())+1,2)]))

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

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

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

def cnt_yakusu(s):
    cnt = 0
    for i in range(1, s+1):
        if s % i == 0:
            cnt += 1
    return cnt
    
ans = 0
for i in range(1,n+1):
    if cnt_yakusu(i) == 8 and i % 2 == 1:
        ans += 1

print(ans)

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

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

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

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

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

    if cnt==8:
        ans+=1

print(ans)

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(10 ** 9)


def main():
    N = int(input())
    if N < 105:
        print(0)
        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

    cnt = 1
    for n in range(106, N + 1):
        if n % 2 == 1:
            d = make_divisors(n)
            if len(d) == 8:
                cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

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

if n >= 105:
  for i in range(105,n+1,2):
    chk = factorization(i)
    t = 1
    for j in chk:
      t *= (j[1]+1)
    if t == 8:
      ans += 1

print(ans)