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:
def divisor(n):
    ret = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ret.append(i)
            if i*i != n:
                ret.append(n//i)
    return ret

n = int(input())
ans = sum(len(divisor(i))==8 for i in range(1,n+1) if i%2)
print(ans)

Submission status: Accepted

Solution code:
def count_divisors(n):
    divisors = 0
    for i in range(1, int(n**0.5) +1):
        if n % i == 0:
            divisors += 1
            if i != n // i:
                divisors += 1

    return divisors

n = int(input())

print(sum(count_divisors(x) == 8 for x in range(1, n+1, 2)))

Submission status: Accepted

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

Submission status: Accepted

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

def num_divisors(n):
  d = 0
  for j in range(1,n+1):
    if n%j == 0:
      d+=1
  return d

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

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
n=int(input())
ans=0
for i in range(n):
    if (i+1)%2==0:
        continue
    cnt=0
    for j in range(i+1):
        if (i+1)%(j+1)==0:
            cnt+=1
    if cnt==8:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

div_num = 0
for n in range(105, N+1, 2):
  div_c = 0
  for t in range(1, n+1):
    if n % t == 0:
      div_c += 1
  if div_c == 8 :
    div_num += 1

print(div_num)

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())
r = []
for i in range(1, n+1,2):
  c = 0
  for j in range(1, n+1):
    if i % j == 0:
      c += 1
  if c == 8:
    r.append(i)
print(len(r))

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

N = int(input())

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

print(count)

Submission status: Accepted

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


print(len(ans))

Submission status: Accepted

Solution code:
N = int(input())
tmp = []
for i in range(N+1):
    if i%2 != 0:
        tmp.append(i)
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
ans = []
for j in range(len(tmp)):
    ans.append(make_divisors(tmp[j]))
count = 0
for k in range(len(ans)):
    if len(ans[k]) == 8:
        count += 1
print(count)

Submission status: Accepted

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

for i in range(1,n+1):
  j=2
  t=1
  x=i
  while j*j<i:
    f=0
    while x%j==0:
      x //= j
      f+=1
    if f != 0:
      t *= f+1
    j+=1
  if x==i:
    t *= 2
  if t==8 and i%2:
    a += 1
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

#1以上N以下の奇数のうち, 正の約数をちょうど8個持つようなものの個数を求めよ.
#素因数のペアとして、357,3511,3513, 3335,3337
#105,165,195

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

Submission status: Accepted

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

    # divisors.sort()
    return divisors

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC106B - 105
def divisors(x: int) -> set:
    """
    Compute divisors of a number.
    
    Args: x (int): an integer to be evaluated.
    Returns: divs (set): set of divisors
    """
    divs = set()
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            divs.add(i), divs.add(x // i)
    return divs


def main():
    N = int(input())
    ans = sum(len(divisors(i)) == 8 for i in range(1, N + 1, 2))
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# p^2*q^2*r^2 ->(p,q,r)=(3,5,7),(3,5,11),(3,5,13)
# p^3*q^2->(3,5),(3,7)
# 105,135,165,189,195
N=int(input())
if N<105:
    ans=0
elif N<135:
    ans=1
elif N<165:
    ans=2
elif N<189:
    ans=3
elif N<195:
    ans=4
else:
    ans=5
print(ans)

Submission status: Accepted

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

    # divisors.sort()
    return divisors
  
N = int(input())
ans = 0
for i in range(1,N+1):
  if i%2==1 and 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,2):
  cnt = 0
  j = 1
  while j**2 <= i:
    if i % j == 0:
      cnt += 2
    j += 1
  if cnt == 8:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
print((N>=195)+(N>=189)+(N>=165)+(N>=135)+(N>=105))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def is8DivisorNumbers(n: int) -> bool:
    cnt = 0
    for i in range(1, n+1):
        if n%i == 0:
            cnt += 1

    return True if cnt == 8 else False

n = int(input())
odds = [i for i in range(1, n+1, 2)]

ans = 0
for odd in odds:
    if is8DivisorNumbers(odd):
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

print(res)

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:
from itertools import combinations
from itertools import permutations
N = int(input())
lis = []
for v in combinations([3,5,7,11,13],3):
  if v[0]*v[1]*v[2] <= N: lis.append(v[0]*v[1]*v[2]) 
for v in permutations([3,5,7],2):
  if (v[0]**3)*v[1] <= N: lis.append((v[0]**3)*v[1]) 

print(len(lis))

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

div_count = 0
sum = 0

for i in range(3,n+1,2):
    a = i
    j = 2
    div_count = 0
    while(j <= a):
        #print("a is",a)
        #print("j is",j)
        if a % j == 0:
            div_count += 1
            a //= j
            j += 1
        else:
            j += 1
    if div_count == 3:
        sum += 1

print(sum)

Submission status: Accepted

Solution code:
n = int(input())


def count_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)
  length = len(divisors)
  return length


l = []
for i in range(1, n + 1):
  if i % 2 == 0:
    continue
  else:
    if count_divisors(i) == 8:
      l.append(i)

      
print(len(l))

Submission status: Accepted

Solution code:
def factorization(n):
    def sieve(n):
        is_prime = [True for _ in range(n+1)]
        is_prime[0] = False

        for i in range(2, n+1):
            if is_prime[i-1]:
                j = 2 * i
                while j <= n:
                    is_prime[j-1] = False
                    j += i
        table = [ i for i in range(1, n+1) if is_prime[i-1]]
        return table
    arr = []
    temp = n
    for i in sieve(int(n**0.5)):
        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
cnt=1
n=int(input())
ans=0
for i in range(1,n+1,2):
    a=factorization(i)
    for j in range(len(a)):
        cnt*=a[j][1]+1
    if cnt==8:
        ans+=1
    cnt=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 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


def main():
    n = int(input())
    if n < 105:
        print(0)
        exit()
    arr = [x for x in list(range(105, n+1)) if x % 2 != 0]

    cnt = 0
    for x in arr:
        if len(make_divisors(x)) == 8:
            cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import collections
def div(n):
    a = []
    for i in range(2,n+1):
        while n % i == 0:
            a.append(i)
            n //= i
    return a
n = int(input())
cnt = 1
ans = 0
for i in range(1,n+1,2):
    a = collections.Counter(div(i))
    a = list(a.values())
    for j in range(len(a)):
        cnt *= (a[j]+1)
    if cnt == 8:
        ans += 1
    cnt = 1
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())
yakusu= 0
for i in range(N+1):
    count = 0
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
        else:
            pass
        if count > 8:
            break
        
    if count == 8 and i % 2 == 1:
        yakusu += 1
    else:
        pass
    
print(yakusu)

Submission status: Accepted

Solution code:
def solve(num):
    result = []
    for i in range(2, int(num**(1/2)+1)):
        counter = 0
        while num%i == 0:
            num /= i
            counter += 1
        if counter >= 1:
            result.append((i, counter))
    if len(result) == 0:
        result = [(1,1)]
    numbers = 1
    for i in result:
        numbers *= i[1]+1
    return numbers
def main():
    n = int(input())
    c = 0
    for i in range(1, n+1, 2):
        r = solve(i)
        if r == 8:
            c += 1
    print(c)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

# 104以下に条件を満たす数は無いらしいので飛ばす
if N <= 104:
    print(0)
else:
    ans = 0
    for n in range(105, N+1, 2):
        d_list = []
        for i in range(1, n//2):
            if n%i == 0:
                d_list.append(i)
        if len(d_list) == 7:
            ans += 1
    print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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)

    # divisors.sort()
    return len(divisors)

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

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)
 
    return divisors


n = int(input())
ans = 0
if n < 105:
    print(0)
else:
    for i in [i for i in range(105,n+1) if i %2 == 1]:
        m = make_divisors(i)
        if len(m) == 8:
            ans += 1   
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

cnt = [0] * (n + 1)
for i in list(i for i in range(1, n + 1) if i % 2 == 1):
    for j in range(1, n + 1):
        if i % j == 0:
            cnt[i] += 1
            if cnt[i] == 8:
                break

print(cnt.count(8))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a_cnt = 0
    for i in range(1, n + 1):
        if i % 2 != 0:
            cnt = 0
            t = i
            cnt = 0
            for j in range(1, i + 1):
                if t % j == 0:
                    cnt += 1
            if cnt == 8:
                a_cnt += 1
    print(a_cnt)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

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)

Submission status: Accepted

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

for i in range(n+1):
    count = 0
    if i%2 == 1:
        for m in range(i+1):
            if m != 0 and i%m == 0:
                count += 1
    if count == 8:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import bisect
print(bisect.bisect_right([105, 135, 165, 189, 195], int(input())))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

N = int(input())
result = 0
for num in range(1,N+1):
    if(num%2>0 and len(make_divisors(num))==8):
        result = result + 1
print(result)

Submission status: Accepted

Solution code:
def f(x):
  a=[]
  for i in range(1, int(pow(x, 1/2))+1, 1):
    if x%i==0:
      a.append(i)
      if x!=pow(i, 2):
        a.append(x//i)
        
  a.sort()
  return a

counter=0
N=int(input())
for i in range(1, N+1, 2):
  a=f(i)
  if len(a)==8:
    counter+=1
    
print(counter)

Submission status: Accepted

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

def divisor(N):
  div = []
  cur = N
  for i in range(1,N+1):
    if cur%i == 0:
      div.append(i)
  return len(div)

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

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

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

Submission status: Accepted

Solution code:
N = int(input())

count_list = []
for num in range(1, N + 1):
    if num % 2 != 0:
        count = 0
        for n in range(1, num + 1):
            if num % n == 0:
                count += 1
            else:
                pass
        count_list.append(count)
    else:
        count_list.append(-1)

print(count_list.count(8))

Submission status: Accepted

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

    # divisors.sort()
    return divisors

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    print(
        sum(
            [
                sum([i % j == 0 for j in range(1, i + 1)]) == 8
                for i in range(1, n + 1, 2)
            ]
        )
    )


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

    if cnt == 8:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
cnt = 0
for k in range(1,a+1):
  if k%2 == 1 and len(make_divisors(k)) == 8:
    cnt += 1
print(cnt)

Submission status: Accepted

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

counter = 0
for i in range(1, n+1, 2):
  yakusuu = 0
  for j in range(1, i // 2 + 1 + 1, 2):
    if i % j == 0:
      yakusuu += 1
#  print(i, j, yakusuu)
  if yakusuu == 7:
    counter += 1
  yakusuu = 0
print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ans=0
L=[105,135,165,189,195]
for l in L:
    if n>=l:
        ans+=1
    else:
        break
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:
N = int(input())
ans = 0
for n in range(1,N+1,2):
    div = 0
    for d in range(1,n+1):
        if n % d == 0:
            div += 1
    if div == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def fact(n):
    num = n
    cnt = [0]*(n+1)
    ans = 1
    for i in range(2, n+1):
        while num % i == 0:
            cnt[i] += 1
            num /= i
    for i in range(2, n+1):
        ans *= cnt[i] + 1
    return ans

n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
d = []
for i in range(1,n+1,2):
    cnt=0
    for j in range(1,i+1):
        if i%j ==0:
            cnt+=1
        d .append(cnt)
print(d.count(8))

Submission status: Accepted

Solution code:
N = int(input())

sum = 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:
            break
    else:
        if cnt == 8:
            sum += 1
print(sum)

Submission status: Accepted

Solution code:
N=int(input())

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
count = 0
output = 0

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

    if count == 8:
        output += 1

print(output)

Submission status: Accepted

Solution code:
import math
N = int(input())
cnt = 0
for j in range(1, N+1, 2):
    ans = []
    for i in range(1, math.ceil(j**0.5)+1):
        if j%i == 0:
            if j//i == i:
                ans.append(i)
            else:
                ans.append(i)
                ans.append(j//i)
    if len(ans) == 8:
        cnt += 1
    ans = []
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l=[]
count=0
for h in range(n):
    for i in range(h+1):
        if (h+1)%(i+1)==0 and (h+1)%2!=0:
            l.append(h+1)
            if len(l)==8:
                count+=1
    if len(l)!=8:
        l.clear()
print(count)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def divisors(n):
    S,T=[],[]
    for i in range(1,int(n**.5)+1):
        if n%i==0:
            S.append(i)
            T.append(n//i)
    T.reverse()
    return S+T if S[-1]!=T[0] else S+T[1:]

def resolve():
    n=int(input())
    ans=0
    for i in range(1,n+1,2):
        ans+=(len(divisors(i))==8)
    print(ans)
resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
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
def resolve():
    n=int(input())
    ans=0
    for i in range(n+1):
        if i%2==0: continue
        D=make_divisors(i)
        if len(D)==8: ans+=1
    print(ans)

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

# ans = 0

# for v in range(1, n + 1, 2):
#     num_divisor = 0
#     for i in range(3, v, 2):
#         if v % i == 0:
#             num_divisor += 1
#     if num_divisor == 6:
#         # print(v)
#         ans += 1

# print(ans)

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)
elif n <= 200:
    print(5)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
if N < 105:
    ans = 0
else:
    for i in range(105, 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)

Submission status: Accepted

Solution code:
num = int(input())

import math

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

if num >105:
    ccount = 1
    temp = 107
    while temp <= num:
        if find_factors(temp)==8:
            ccount +=1
        temp+=2
    print (ccount)
elif num ==105:
    print ("1")
elif num < 105:
    print ("0")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

def divisor_num(n):
  ass = []
  for i in range(1,n+1):
    if n%i == 0:
      ass.append(i)
      if i**2 == n:
        continue
        ass.append(n//i)
  return len(ass)

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

Submission status: Accepted

Solution code:
anslist=(3*5*7,
         3*5*11,
         3*5*13,
        3*5**3,5*3**3,7*3**3)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
a = [3*5*7,3**3*5,3**3*7,3*5*11,3*5*13]
N = int(input())
ans = 0
for i in a:
  if N>=i:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
def count_divisors(num):
  factor = 2
  divisors = 1
  
  while num > 1:
    exp = 0
    while num % factor == 0:
      num //= factor
      exp += 1
    divisors *= (exp + 1)
    factor += 1
    
  return divisors

n = int(input())
res = 0

for i in range(1, n + 1, 2):
  if count_divisors(i) == 8:
    res += 1
    
print(res)