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:
import numpy as np

def countf(a):
    count = 0

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

n = input()
n = int(n)

count = 0

ls = []

for i in range(1, n + 1, 2):
    if(countf(i) == 8):
        count += 1
        ls += [i]

'''   
print(ls)

print("ここまで")
'''

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


def divisor(div, N):
    # 約数
    i = 1
    n = N

    while i <= math.sqrt(n):
        if n % i == 0:
            div.append([i, n // i])
        i += 1


N = int(input())

cnt = 0

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

    div = []
    divisor(div, i)

    if len(div) == 4:
        cnt += 1

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# B
n = int(input())
ans = 0
for i in range(1, n+1)[0::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())
c = []
for i in range(1,n+1):
    k = []
    for j in range(1,i+1):
        if i % j == 0:
            k.append(j)

    if len(k) == 8:
        if i % 2 != 0:
            c.append(i)
print(len(c))

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

Submission status: Accepted

Solution code:
n = int(input())
odd = [i for i in range(1, n+1, 2)]
[[a * b for a in range(1, 4)] for b in range(1, 4)]
yakusu_list = [[i for i in odd if j%i == 0] for j in odd]
c = len([i for i in yakusu_list if len(i) == 8])
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(sum)

Submission status: Accepted

Solution code:
N = int(input())
if N < 105:
    print(0)
    exit()
elif N == 105:
    print(1)
    exit()
else:
    dP ={2,3,5,7}
    for i in range(10,int(200**0.5)+2):
        bF = True
        for j in dP:
            if 0 == i % j :
                bF = False
                break
        if bF:
            dP.add(i)
    aP = sorted(list(dP - {2}))
    iL = len(aP)
    aN = []
    for i in range(iL):
        i1 = aP[i]
        i3 = i1**3
        for j in range(i+1,iL):
            j1 = aP[j]
            aN.append(i3*j1)
            for k in range(j+1,iL):
                k1 = aP[k]
                aN.append(i1*j1*k1)
                aN.append(i3*k1)

    aN = sorted(list(set(aN)))
    for i in range(len(aN)):
        if N < aN[i]:
            print(i)
            exit()

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,N+1):
    if(i%j == 0):
      cnt += 1
  if(cnt == 8):
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
i = 1
counter = 0

while i <= n:
    answer = 0
    k = 1
    while k**2  < i:
        if i % k == 0:
            if i == k**2:
                answer+=1
            else:
                answer += 2
        k+=1
    i += 2
    if answer == 8:
        counter+=1

print(counter)

Submission status: Accepted

Solution code:
from collections import Counter
class Solver(object):
    def __init__(self):
        self.n = int(input())
        self.primes = Solver.generate_primes(self.n)

    def solve(self):
        count = 0
        for i in range(2, self.n+1):
            if i % 2 != 0:
                factors = self.prime_factorize(i)
                if len(set(factors)) == len(factors):
                    if self.has_eight(factors):
                        # print(i, factors)
                        count += 1
                else:
                    c = Counter(factors)
                    s = list(c.keys())
                    if len(s) == 2:
                        if (c[s[0]] == 1) and (c[s[1]] == 3) or ((c[s[0]] == 3) and (c[s[1]] == 1)):
                            # print(i, factors)
                            count += 1

        print(count)
    
    def has_eight(self, factors):
        return len(set(factors)) == 3

    def prime_factorize(self, n):
        factor = []
        for i in self.primes:
            if i > n:
                break
            if n % i == 0:
                factor.append(i)
                n = int(n/i)
                while n % i == 0:
                    factor.append(i)
                    n = int(n/i)
        return factor

    @staticmethod
    def generate_primes(length):
        """Generate prime from 1 to length, inclusive"""
        primes = []
        if length < 2:
            return primes
        numbers = range(2, length+1)  # 2 .. length
        i = numbers[0]
        while True:
            primes.append(i)
            new_numbers = []
            for j in numbers:
                if j % i != 0:
                    new_numbers.append(j)
            numbers = new_numbers
            if len(numbers) == 0:
                break
            i = numbers[0]
        return primes


if __name__ == "__main__":
    s = Solver()
    s.solve()

Submission status: Accepted

Solution code:
n = int(input())
if 1 <= 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 <= 200:
    print("5")

Submission status: Accepted

Solution code:
import math

n = int(input())
count = 0
for i in range(1, n+1, 2):
    lst = [0] * 20
    for j in range(2, int(math.sqrt(i))+1):
        if i % j == 0:
            lst[j] += 1
    a = 1
    for k in lst:
        a *= (k+1)
    if a == 8:
        count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
for i in range(1,n+1):
    if i%2 == 1:
        if len([x for x in range(1,n+1) if i % x == 0]) == 8:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

odd = [i for i in range(1,201,2)]
odd_y = [1 for i in range(1,201,2)]

for i in range(len(odd)):
    for k in range(1,i+1):
        if odd[i] % k == 0:
            odd_y[i] += 1
        else:
            pass

all = []

for i in range(len(odd_y)):
    if odd_y[i] == 8:
        all.append(odd[i])

# print(all)
count = 0
for i in all:
    if n >= i:
        count += 1

print(count)

Submission status: Accepted

Solution code:
n=int(input())
ansList=[105, 135, 165, 189, 195]
m=len(list(filter(lambda x:x<=n,ansList)))
print(m)

Submission status: Accepted

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

print(anscount)

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())
rs = 0
cn = 0
for i in range(1,n+1,2):
    for j in range(1,i+1):
        if i%j==0:
            rs += 1
    if rs==8:
        cn += 1
    rs = 0
print(cn)

Submission status: Accepted

Solution code:
N = int(input())
print(len([numlist for numlist in [[num for num in range(1,kisu+1) if kisu%num == 0] for kisu in [i for i in range(N+1) if i%2!=0]] if len(numlist)==8]))

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

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

Submission status: Accepted

Solution code:
def judge(jnum):
    res = 0
    if (jnum & 1) == 0:
        return False
    for k in range(1,jnum+1):
        if jnum % k == 0:
            res += 1
    if res == 8:
        return True
    else:
        return False

N = int(input())
num = 0
for i in range(1,N+1):
    if judge(i):
        num += 1
print(num)

Submission status: Accepted

Solution code:
def judge(N):
    cnt = 0
    if (N & 1) == 0:
        return False
    for i in range(1, N+1):
        if N % i == 0:
            cnt += 1
    if cnt == 8:
        return True
    else:
        return False

N = int(input())
cnt = 0
for i in range(1, N+1):
    if judge(i):
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
count_number=0
for i in range((N-105)//2+1):
  count_yakusu=0
  for j in range((2*i+105)//2+1):
    if((2*i+105) % (2*j+1)==0):
      count_yakusu+=1
    else:continue
  if(count_yakusu==8):
    count_number+=1
  else:continue
print(count_number)

Submission status: Accepted

Solution code:
""" AtCoder """

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:
#!/usr/bin/env python3

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

def main():
    n = int(input())
    res = 0
    for i in range(1, n + 1):
        if i % 2 == 1 and len(dividors(i)) == 8:
            res += 1
    print(res)

main()

Submission status: Accepted

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

N = int(input())

ans = 0
for j in range(1, N+1):
    if j % 2 == 0:
        continue
    s = int(j / 3)
    count = 0
    for i in range(1, s+1):
        if j % i == 0:
            count += 1
    if count == 7:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(1,n+1):
    a = 0
    for l in range(1,i+1):
        if i%l == 0:
            a += 1
    if a == 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,2):
  tmp=0
  t=i**(1/2)
  for j in range(1,int(t)+1):
    if i%j==0:
      tmp+=1
      
  tmp=tmp*2
  if t-int(t)<=1e-3:
    tmp-=1

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    ans = 0
    for n in range(1, N + 1, 2):
        c = 0
        for i in range(1, N + 1):
            if c > 8:
                break
            if n % i != 0:
                continue
            c += 1
        if c == 8:
            ans += 1
    print(ans)


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(n):
    t = 1
    count = 0
    while(n>=t**2):
        if n%t == 0:
            count += 2 if t != n//t else 1
        t += 1
    return count

N = int(input())
count = 0
for i in range(1,N+1):
    if f(i) == 8 and i%2:
        count += 1
print(count)

Submission status: Accepted

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

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

    a = [3 ** 3 * 5, 3 ** 3 * 7, 3 * 5 * 7, 3 * 5 * 11, 3 * 5 * 13]
    a.sort()

    print(bisect.bisect_right(a, N))


if __name__ == '__main__':
    main()

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(N//2+1):
    x=2*n+1
    if x>N:
         break

    num = 0
    for i in range(1,x+1):
        if x%i == 0:
            num +=1
        if num>8:
            break
    if num == 8:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
def check(n):
    """
    nの約数が8個かどうかを調べる
    """
    count = 0
    for i in range(1, n + 1):
        if n % i == 0:
            count += 1

    if count == 8:
        # print(n)
        return True
    else:
        return False


def main():
    n = int(input())
    count = 0
    for i in range(3, n + 1, 2):
        if check(i):
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list

n = int(input())

ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def divisor(N):
    l = []
    for i in range(1,N+1):
        if N % i == 0:
            l.append(i)
    return len(l)
ans =0
for i in range(N+1):
    if divisor(i)==8 and i % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

a = [0] * N
nums_count = 0
for num in range(1,N + 1):
    if num % 2 == 0:
        continue
    count = 0
    for i in range(1,num + 1):
        if num % i == 0:
            count += 1
    if count == 8:
        nums_count += 1

print(nums_count)

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, N+1, 2):
		if i % j == 0:
			cnt += 1
	if cnt == 8:
		ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

if(counti==8):
    count+=1



print(count)

Submission status: Accepted

Solution code:
n = int(input())

count=0
i = 1
A= []
for j in range(1, n+1, 2):
    while(i*i<=j):
        if(j%i==0):
            count+=1
        i+=1
    if(count==4):
        A.append(j)
    i = 1
    count=0

print(len(A))

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())

lst = [3*5*7, 3*3*3*5, 3*5*11, 3*3*3*7, 3*5*13]
ans = 0
for num in lst:
    if num <= N:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def count_div(n):
    ans=0
    u = int(math.sqrt(n))+1
    for i in range (1,u):
        if n%i==0:
            ans+=2
    return ans

n = int(input())
res=0
for i in range (1,n+1):
    if i%2==0:
        continue
    if count_div(i)==8:
        res+=1
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# for num in range(1, 200+1):
#     divisor_array = []
#     for i in range(1, num+1):
#         if num % i == 0:
#             divisor_array.append(i)
#     else:
#         if len(divisor_array) == 8 and num % 2 == 1:
#                 print(num)
# ----result----
# 105
# 135
# 165
# 189
# 195
# --------------

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())
odd = [i for i in range(N + 1) if i % 2 == 1]
ans = 0

for i in range(len(odd)):
    count = 0
    for x in range(1, odd[i] + 1):
        if odd[i] % x == 0:
            count += 1
    if count == 8:
        ans += 1
    count = 0

print(ans)

Submission status: Accepted

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

def main():
    """Function."""
    n = int(input())

    vals = []
    for i in range(100):
        base = (i * 2) + 1

        counter = 0
        max_num = int(math.sqrt(base))
        for j in range(1, max_num+1):
            if base % j == 0:
                counter += 2

        if counter == 8:
            vals.append(base)

    counter = 0
    for dum in vals:
        if dum <= n:
            counter += 1

    print(counter)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
def divisor(x):
  return len([i for i in range(1, x//2+1) if x%i==0]) + 1
print(len([i for i in range(1, n+1, 2) if divisor(i)==8]))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
count= 1
ans = 0
N = int(input())
for i in range(1,N+1):
    for k in range(1,i+1,2):
        if i % k ==0:
            count+=1
    #print(i,count)
    if count == 8:
        ans+=1
    count=0
print(ans)

Submission status: Accepted

Solution code:
#B 105
a = int(input())
s = 0
k = 0
if a%2==0:
    a-=1
if(a > 105):
    for i in range(105,a+2,2):
        #print(i)
        for j in range(1,i+1):
            if i%j==0:
                #print(i,j)
                k+=1
        if k==8:
            s+=1
        k = 0
elif a == 105:
    s=1
print(s)

Submission status: Accepted

Solution code:
def divisors(n):
    res = 0
    for i in range(1, n + 1):
        if n % i == 0:
            res += 1
    return res


def main():
    n = int(input())
    res = 0
    for i in range(1, n + 1, 2):
        d = divisors(i)
        if d == 8:
            res += 1
    print(res)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
con = []
counter = 0

for i in range(1, N+1):
    if i % 2 == 1:
        for s in range(1, i+1):
            if i % s == 0:
                counter += 1
            
        con.append(counter)
        counter = 0


print(con.count(8))

Submission status: Accepted

Solution code:
import sys
import math

N = int(input())

if N < 105:
    print(0)
    sys.exit()

odd_num = 105
result = 0

while odd_num <= N:
    divisor_count = 0
    for i in range(1, odd_num + 1):
        if odd_num % i == 0:
            divisor_count += 1

    if divisor_count == 8:
        result += 1
        
    odd_num += 2

print(result)

Submission status: Accepted

Solution code:
#105 という数は, 非常に特殊な性質を持つ - 奇数なのに, 約数が 8 個もある.
#さて, 1 以上 N 以下の奇数のうち, 正の約数を ちょうど 8 個持つようなものの個数を求めよ.
# N は 1 以上 200 以下の整数
# 入力は奇数

N = int(input())
# 半分にして、割れるものをカウント
# 105の場合、[1, 3, 5, 7, 15, 21, 35, 105]


ans_num = 0


for a in range(1, N + 1):
  yakusuu = []
  if a % 2 == 0:
    continue
  for i in range(1, a+1):
    if a % i == 0:
      yakusuu.append(i)
  if len(yakusuu) == 8:
    ans_num = ans_num + 1

print(ans_num)

Submission status: Accepted

Solution code:
N = int(input())

X = [3, 5, 7, 11, 13, 17]
D = []

for i in range(len(X)-2):
  for j in range(i+1, len(X)-1):
    t = X[i]*X[i]*X[i]*X[j]
    if t <= N:
      D.append(t)
    for k in range(j+1, len(X)):
      t = X[i]* X[j] * X[k]
      if t <= N:
        D.append(t)
      else:
        break
    
print(len(D))

Submission status: Accepted

Solution code:
n = int(input())
a = [105,135,165,189,195]
if n < 105:
    print(0)
elif 105 <= n < 135:
    print(1)
elif 125 <= n < 165:
    print(2)
elif 165 <= n < 189:
    print(3)
elif 189 <= n < 195:
    print(4)
else:
    print(5)

Submission status: Accepted

Solution code:
N = int(input())

def main():
    ans = 0
    for i in range(1, N + 1):
        if i % 2 == 0: continue
        divs = list(filter(lambda x: i % x == 0, range(1, i + 1)))
        if len(divs) == 8:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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


n = int(input())
print(sum(1 for i in range(1, n + 1, 2) if yaku(i) == 8))

Submission status: Accepted

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

Submission status: Accepted

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

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

for number in range(1,n+1):
    if judge_divisor(number):
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())


# def yakusuu(x):
#     tmplist=list(sy.factorint(x).values())
#     a=1
#     for i in tmplist:
#         a*=i+1
#     return a
def make_prime_list_2(num):
    if num < 2:
        return []

    # 0のものは素数じゃないとする
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0  # 1は素数ではない
    num_sqrt = math.sqrt(num)

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

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

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


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

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

        if num != 1:
            divisor_num *= 2

        return divisor_num


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 値の取得
N = int(input())
# Nまでに奇数を配列にする
n = [i for i in range(1, N + 1)]
res = 0
# それぞれの奇数に8個約数があるか計算
for i, x in enumerate(n):
    count = 0
    for j in range(1, x + 1, +2):
        if x % j == 0:
            count += 1
    if count == 8:
        res += 1
print(res)

Submission status: Accepted

Solution code:
n=int(input())

def yakusu_num(x):
    cnt=0
    for i in range(x):
        if x%(i+1)==0:
            cnt+=1
    return(cnt)

ans=0
for i in range(-(-n//2)):
  if yakusu_num(2*i+1)==8:
    ans+=1
  
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d = {i: 0 for i in range(n+1)}
for i in range(1, n+1):
    for j in range(1, n+1):
        if j%i == 0:
            d[j] +=1
a = 0
for k, v in d.items():
    if k%2 == 1 and v == 8:
        a +=1
print(a)

Submission status: Accepted

Solution code:
import itertools
N = int(input())
arr = [1 for i in itertools.combinations(range(3,15,2),3) if i[0] * i[1] * i[2] <= N]
print(sum(arr))

Submission status: Accepted

Solution code:
a=int(input())
b=[]
for k in range(1,a+1):
	c=[]
	b.append(c)
	for i in range(a+1):
		if k%(2*i+1)==0:
			c.append(2*i+1)
#print(b)
d=0
for i in b:
	if len(i)==8:
		d=d+1
print(d)

Submission status: Accepted

Solution code:
def countnum(n):
    count = 0
    for val in range(1,n+1):
        if n % val == 0:
            count += 1
    return count

N = int(input())
count = 0
for v in range(1, N+1):
    if (v % 2 == 1) and (countnum(v) == 8):
        count += 1

print(count)