Problem:


Score: 200 points

Problem Statement

The number 105 is quite special - it is odd but still it has eight divisors.
Now, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?

Constraints

N is an integer between 1 and 200 (inclusive).

Input

Input is given from Standard Input in the following format:

N

Output

Print the count.

Sample Input 1

105

Sample Output 1

1

Among the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.

Sample Input 2

7

Sample Output 2

0

1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.



Sample input:
105


Sample output:
1

Submission status: Accepted

Solution code:
N=int(input())
#N個以下
ans=0
if N<=104:
  ans=0
elif N==105:
  ans=1
else:#106から調べる
  ans=1
  for i in range(106,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:
          break
    if cnt==8:
      ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
res = [0 for _ in range(N + 1)]

for i in range(1, N + 1):
	for j in range(1, N + 1):
		if j < i or j % 2 == 0: continue
		if j % i == 0:
			res[j] += 1
ctr = 0			
for r in res:
	if r == 8:
		ctr += 1
		
print(ctr)

Submission status: Accepted

Solution code:
n = int(input())
lst = [135, 189, 105, 165, 195]
tmp = 0
x = []

for i in range(5):
    x.append(n-lst[i])

for i in range(5):
    if x[i]>=0:
        tmp += 1

print(tmp)

Submission status: Accepted

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

for i in range(3,n+1,2):
    y = 1
    cnt = 0
    for j in range(3,int((i**0.5)//1)+1,2):
        while i%j == 0:
            i //= j
            cnt += 1
        y *= cnt+1
        cnt = 0
    if i != 1: y *= 2
    if y == 8: ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in 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)

Submission status: Accepted

Solution code:
def prime_factorization(N):
	'''
	return: [[2,3], [3,5]] (2^3 * 3^5)
	        [] if N==1
	O(sqrt{N}) (maybe)
	'''
	ans = []
	cnt=0
	while N%2==0:
		cnt+=1
		N//=2
	if cnt!=0:
		ans.append([2,cnt])
	
	f = 3
	while f*f<=N:
		cnt=0
		while N%f==0:
			N//=f
			cnt+=1
		if cnt!=0:
			ans.append([f,cnt])
		f+=2
	if N!=1:
		ans.append([N,1])
	return ans


N = int(input())
ans = 0
for i in range(1,N+1,2):
	T = prime_factorization(i)
	s = 1
	for t in T:
		s *= t[1]+1
	if s==8:
		ans += 1
print(ans)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
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)
cnt = 0
for i in range(1, N+1, 2):
    if make_divisors(i) == 8:
        cnt += 1
print(cnt)

Submission status: Accepted

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

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(1, N+1):
    # print(len(make_divisors(i)), make_divisors(i))
    if i % 2 == 1 and len(make_divisors(i)) == 8:
        count += 1

print(count)

Submission status: Accepted

Solution code:


N = int(input())
import math


def solve(num):
        count = 0
        for i in range(1, int(math.sqrt(num)) + 1):
                if num % i == 0:
                        if (num // i) != i:
                                count += 2
                        else:
                                count += 1
        if count == 8:
                return 1
        else:
                return 0

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

Submission status: Accepted

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

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)
    return divisors
for i in range(N+1):
	length = 0
	if(i%2==1):
		divi = make_divisors(i)
		length = len(divi)
	if(length == 8):
		cnt+=1
print(cnt)

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 divisors

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

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

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

print(cnt)

Submission status: Accepted

Solution code:
def divisor(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(2,n+1):
    num=divisor(i)
    if i%2==1 and len(num)==8:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())
ans=[]
for i in range(1,n+1,2):
    div=0
    for j in range(1,int(math.sqrt(i)//1)+1):
        if(i%j==0):
            div+=1

    if(div==4):
        ans.append(i)

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for j in range(n + 1):
    ass = []
    for i in range(1, int(j**0.5)+1):
        if j % i == 0:
            ass.append(i)
            if i**2 == j:
                continue
            ass.append(j//i)
    if j % 2 == 1 and len(ass) == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

if N >=106:
    for i in range(1,N+1):
        cnt =0
        for j in range(1,i+1):
            if i%j ==0:
                cnt +=1
        if cnt ==8 and i%2 ==1:
            cnt_all+=1
    print(cnt_all)

elif N==105:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

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

a=[1 for i in range(1,int(input())+1,2) if len(f(i))==8]
print(len(a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def divisor(n):
    limit = int(n**0.5 + 1)
    divisors = set()
    for div in range(1, limit):
        if n % div == 0:
            div2 = n//div
            divisors.add(div)
            divisors.add(div2)
    return len(divisors)


n = int(input())
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

if N < 105:
    print(0)
else:
    res = 1
    for i in range(107, N+1, 2):
            sum = 0
            for j in range(1, i+1):
                if (i % j) == 0:
                    sum += 1
            if (sum == 8):
                res += 1
    print(res)

Submission status: Accepted

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

lst_c = collections.Counter(lst)
print(lst_c[8])

Submission status: Accepted

Solution code:
def divisor(n):
    limit = int(n**0.5 + 1)
    divisors = set()
    for div in range(1, limit):
        if n % div == 0:
            div2 = n//div
            divisors.add(div)
            divisors.add(div2)
    return len(divisors)


n = int(input())
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())


def f(x):
    li = [i for i in range(1, x + 1) if x % i == 0]
    # print(li)
    return len(li)


cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

num = list(range(1, N+1))
num = num[::2]

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 = []
for n in num:
  ans.append(len(make_divisors(n)))

print(ans.count(8))

Submission status: Accepted

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

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 = 0

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

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

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

    if count==8:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
n_cnt = 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 j == n and cnt == 8:
      n_cnt += 1
print(n_cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = 0
for i in range(1, n + 1, 2):
    c = 0
    sq = int(i ** 0.5)
    for j in range(1, sq + 1):
        if i % j == 0:
            c += 1
    if c == 4:
        s += 1

print(s)

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
a=int(input());print(len([1 for i in [52,67,82,94,97] if 2*i<a]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=[]
for i in range(201)[105::2]:
  d=1;k=i
  for h in range(2,i+1):
    if i%h==0:
      cnt=0
      while i%h==0:
        cnt+=1
        i//=h
      d*=(cnt+1)
  if d==8:
    s.append(k)
ans=0;n=int(input())
for f in s:
  if n>=f:ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input()) + 1
ans = 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 val in range(n):
    if len(make_divisors(val)) == 8 and val%2 != 0:
        ans += 1
print(ans)

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:
n = int(input())
odds = [i for i in range(1, n+1) if i%2 == 1]

ans = 0
for o in odds:
    cnt = 0
    for j in range(1, o+1):
        if o%j == 0:
            cnt+=1
    if cnt == 8:
        ans+=1
        
print(ans)

Submission status: Accepted

Solution code:
def yakusu_count(x):
    # for i in range(1, x+1):
    #     if x % i == 0:
    #         count += 1
    # return count
    return len([i for i in range(1, x + 1) if x % i == 0])


def main():
    N = int(input())
    # count = 0

    # for i in range(1, N+1, 2):
    #     if yakusu_count(i) == 8:
    #         count += 1

    count = len([i for i in range(1, N+1, 2) if yakusu_count(i) == 8])

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

l = []

check = 0

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

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for candi in range(1, N + 1, 2):
    num_divisor = 0
    div = 1
    while div**2 <= candi:
        if candi % div == 0:
            num_divisor += 2
        div += 1
    if num_divisor == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
N=int(input())
c8=0 # 約数が8個の奇数の数

# 各奇数について
for ni in range((N-1)//2+1):
    n=ni*2+1
    c=0 # 約数の数

    for i in range(1,n+1): # 各数について、割り切れるかどうかを判定してゆく
        c+=int(n%i==0)

    if c==8: # 約数が8個なら
        c8+=1

print(c8)

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

Submission status: Accepted

Solution code:
A = int(input())
k = 1
if A < 105:
  print(0)
elif A == 105 and A == 106:
  print(1)
else:
  for a in range(107,A+3,2):
    count = 0
    for i in range(1,A+3,2):
      if a % i == 0:
        count = count + 1
      elif count == 8 and A+1 <= i:
        k = 1+k
  print(k)

Submission status: Accepted

Solution code:
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct
N = int(input())
ans = 0
for i in range(1,N+1):
    if i%2 == 0:
        continue
    else:
        tmp = factorize(i)
        if len(tmp) == 2:
            if tmp[0][1]*tmp[1][1] ==3:
                ans += 1
        if len(tmp) == 3:
            if tmp[0][1]*tmp[1][1]*tmp[2][1] ==1:
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(N+1):
    if i % 2 == 0:
        continue
    tmp = []
    for j in range(1, int((i+1)**(1/2))+1):
        if i % j == 0:
            tmp.append(i)
            tmp.append(j)
    if len(tmp) == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(1, N + 1, 2):
    res = 0
    for j in range(1, i):
        if i < j * j:
            break
        if i % j == 0:
            if j != i / j:
                res += 2
            else:
                res += 1
    if res == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from bisect import bisect_right
li = [105, 135, 165, 189, 195]
N = int(input())
ans = bisect_right(li,N)
print(ans)

Submission status: Accepted

Solution code:
def divide(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())
if n < 105:
	print (0)
	exit()
ans = []
for i in range(105,n+1):
	if i % 2 == 0:
		continue
	s = divide(i)
	if len(s) == 8:
		ans.append(i)

print(len(ans))

Submission status: Accepted

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


def solve(N: int):
    ans = 0
    for n in range(1, N+1):
        count = 0
        if n % 2 == 0:
            pass
        else:
            for i in range(1, n+1):
                if n % i == 0:
                    count += 1
            if count == 8:
                ans += 1
    print(int(ans))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

    # divisors.sort()
    return divisors

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

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

Submission status: Accepted

Solution code:
N = int(input())
l = [105, 135, 165, 189, 195]
ans = 0
if N >= 105:
  for i in range(5):
    if l[i] <= N:
      ans += 1
    else:
      break

print(ans)

Submission status: Accepted

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

N = int(input())
ans = 0
for i in range(1,N+1,2):
    ans += cntDiv(i)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

ans = 0
for i in range(1,n+1):
    if i % 2 == 1:
        div = make_divisors(i)
        if len(div) == 8:
            ans += 1
        
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)
    return divisors
ans = 0
for i in range(11, N+1, 2):
    if len(make_divisors(i)) == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 106: B – 105
import itertools

n = int(input())

odd_primes = [3, 5, 7, 11, 13, 17, 19, 23]
the_number = 0

for comb in list(itertools.combinations(odd_primes, 3)):
    if comb[0] * comb[1] * comb[2] <= n:
        the_number += 1

for comb in list(itertools.combinations(odd_primes, 2)):
    if comb[0] ** 3 * comb[1] <= n:
        the_number += 1

print(the_number)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(sum([1 for p in P if N >= p]))

Submission status: Accepted

Solution code:
n = int(input())

to = 0
for i in range(1, n+1):
	if i%2 == 1:
		cnt = 0
		for j in range(1, i):
			if i%j == 0:
				cnt += 1
		if cnt == 7:
			to += 1
print(to)

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:
from sys import stdin
from itertools import product


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

print(point)

Submission status: Accepted

Solution code:
# B - 105
N = int(input())

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

print(ans)

Submission status: Accepted

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

def yakusuu(num):
  yakusuu_array = []
  for j in range(1,num):
    if num % j == 0:
          yakusuu_array.append(j)
  return len(yakusuu_array)


for i in range(N):
  if (i+1) % 2 == 1 and yakusuu(i+1) == 7:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


def yakusuu(num):
    counter = 0
    for i in range(1, num + 1):
        if num % i == 0:
            counter += 1
    return counter


c = 0
for num in range(1, N + 1, 2):
    if yakusuu(num) == 8:
        c += 1

print(c)

Submission status: Accepted

Solution code:
import sys,math
def input():
    return sys.stdin.readline()[:-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#                         author:  kagemeka 
#                         created: 2019-11-09 15:46:24(JST)
### modules
## from standard library
import sys
# import collections
import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## from external libraries
# import scipy.special   
# import scipy.misc      
# import numpy as np 
def divisors(n):
    divisors = []
    for i in range(1, n + 1):
        if n % i == 0:
            divisors.append(i)
    return divisors


def main():
    n = int(sys.stdin.readline().rstrip())
    
    count = 0
    for i in range(1, n + 1, 2):
        if len(divisors(i)) == 8:
            count += 1
    
    print(count)




if __name__ == "__main__":
    # execute only if run as a script
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for n in range(1, N+1, 2):
    i = 1
    cnt = 0
    while(i*i <= n):
        if (n%i == 0):
            cnt += 1 + (n//i != i)
        i += 1
    ans += (cnt==8)
print(ans)

Submission status: Accepted

Solution code:
n=max(int(input())-75,0);c=int(n>113);print(n//30+c)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

l1 = []
for n in range(1, N+1, 2):
  l = []
  for j in range(1, n+1):
    if(n % j == 0):
      l.append(j)
  if(len(l) == 8):
    l1.append(n)
print(len(l1))