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


N = int(input())

cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
iog = [105, 135, 165, 189, 195]

n = int(input())
if(n in iog):
    print(iog.index(n) + 1)
else:
    iog.append(n)
    iog.sort()
    print(iog.index(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import sqrt, ceil

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
if n>=105:
    ans +=1

if n>=135:
    ans +=1

if n>=165:
    ans +=1

if n>=189:
    ans +=1

if n >=195:
    ans +=1

print(ans)

Submission status: Accepted

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

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:
# ABC106b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n = int(input())

ans = 0

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

Submission status: Accepted

Solution code:
n=int(input())

result=0
for i in range(1,n+1):
  cnt=0
  if i%2==1:
    for j in range(1,i+1):
      if i%j==0:
        cnt+=1
        #print(i,j)
  if cnt==8:
    #print(">>",i)
    result+=1
    
print(result)

Submission status: Accepted

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

N = int(input())
ans = 0
for i in range(1,N+1,2):
  if is_divisor_8(i) is True:
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(nSum)

Submission status: Accepted

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

print(nSum)

Submission status: Accepted

Solution code:
n = int(input())
count = 0
for ni in range(1,n+1):
    if ni%2 == 1:
        nj_count = 0
        for nj in range(1,ni+1):
            if ni%nj == 0:
                nj_count += 1
        if nj_count == 8:
            count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

print(res)

Submission status: Accepted

Solution code:
import collections

n = int(input())


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


sieve = eratosthenes(n)

res = 0
for k in range(1, n + 1, 2):
    counter = collections.Counter()
    for i in range(1, k):
        if sieve[i]:
            while k % i == 0:
                counter[i] += 1
                k //= i
    p = 1
    for v in counter.values():
        p *= v + 1
    if p == 8:
        res += 1

print(res)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os, sys, re, math

def doit(N):
    ret = 0
    for i in range(105, N+1, 2):
        if countit(i) == 8:
            ret += 1
    return ret


def countit(N):
    cnt = 0
    for i in range(1, N+1):
        if N % i == 0:
            cnt += 1
    return cnt

N = int(input())
print(doit(N))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
count=0
for num in range(1,a+1):
    c=0
    if(num%2==1):
        for i in range(1,num+1):
            if num%i==0:
                c+=1
        if c==8:
            count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line = raw_input()
n = int(line)
# 3 5 7 105
# 3 3 3 5 135
# 3 5 11 165
# 3 3 3 7 189
# 3 5 13 195
r = [105, 135, 165, 189, 195]

print len([i for i in r if n >= i])

Submission status: Accepted

Solution code:
import os, sys, re, math

lines = sys.stdin.readlines()

(N) = int(lines[0])

factors = dict()
for i in range(201):
    for j in range(201):
        m = i * j
        if m <= 200:
            if not m in factors:
                factors[m] = []
            factors[m].append(i)

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

print (count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
i = 0
j = 0
count = 0
flag = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = [ 3**7, 3*3*3*5, 3*3*3*7, 3*3*3*11, 3*5*7, 3*5*11, 3*5*13, 3*5*17, 3*7*11, ]
#print(l)
N = int(input())
r = len(list(filter(lambda i: i <= N, l)))
print(r)

Submission status: Accepted

Solution code:
def make_divisors(n):
    '''
    nの約数リストを返す
    '''
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0 and i % 2 == 1:
            divisors.append(i)
            if i != n // i and n//i % 2 == 1:
                divisors.append(n//i)
    # divisors.sort()
    return divisors


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

Submission status: Accepted

Solution code:
n = int(input())

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

def ans(x):
    c = 0
    for i in range(1, x+1):
        if cnt(i) == 8:
            c += 1
    return c

print(ans(n))

Submission status: Accepted

Solution code:
N = int(input())

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

print(x)

Submission status: Accepted

Solution code:
N=int(input())

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

print(x)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
L = [x for x in range(1, N + 1) if x % 2 != 0]

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
oddlist = []
tmp = 0
c = 0

for i in range(100):
  if 2*i+1 <= n:
    oddlist.append(2*i+1)
    
for j in oddlist:
  for k in range(1,201):
    if j%k == 0:
      tmp += 1
  if tmp == 8:
    c += 1
  tmp = 0
  
print(c)

Submission status: Accepted

Solution code:
def num_divisors(n):
  res = 0
  i = 1
  while i * i <= n:
    if n % i == 0:
      res += 1
      res += 1 if i * i != n else 0
    i += 1
  return res


N = int(input())
res = 0
for n in range(1, N + 1, 2):
  if num_divisors(n) == 8:
    res += 1
print(res)

Submission status: Accepted

Solution code:
N = int(input())

c = 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:
        c += 1

print(c)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

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

n = ni()
ans = 0
for i in range(1, n+1, 2):
    ct = 0
    for j in range(1, i+1):
        if i % j == 0:
            ct += 1
    if ct == 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:
# ABC106 B - Shiritori 
n = int(input())

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


print(ans)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()
c = 0
for num in range(3, n+1, 2):
    d = 0
    for i in range(1, num+1):
        if num % i == 0:
            d += 1
    
    if d == 8:
        c += 1
print(c)

Submission status: Accepted

Solution code:
n = int(input())

targets = []
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:
        targets.append(i)
print(len(targets))

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

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

Submission status: Accepted

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

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

#    print(count)
    if count == 8:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
answers = [105, 135, 165, 189, 195]
for i, a in enumerate(answers):
  if n < a:
    print(i)
    break
  
else:
  print(5)

Submission status: Accepted

Solution code:
primes = [2]
for i in range(3, 200):
  for prime in primes:
    if i % prime == 0:
      break
  else:
    primes.append(i)
    
n = int(input())

ans = 0
for i in range(1, n + 1, 2):
  count = 0
  for prime in primes:
    if i % prime == 0:
      i //= prime
      count += 1
  if i == 1 and count == 3:
    ans += 1
    
for i in [3, 5]:
  for prime in primes[1:25]:
    if (i ** 3) * prime <= n and i != prime:
      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())
count = 0
for i in range(1, N + 1, 2):
    if len(make_divisors(i)) == 8:
        count+=1

print(count)

Submission status: Accepted

Solution code:
from math import sqrt 

def count_divisor(n):
  count = 0
  for d in range(1, int(sqrt(n+1))):
    if n%d == 0:
      count+=1  
  return count*2      

n = int(input())
count = 0
for i in range(1,n+1,2):
  if count_divisor(i)==8:
    count+=1
print(count)

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:
    if n>=135:
        if n>=165:
            if n>=189:
                if n>=195:
                    print(5)
                else:
                    print(4)
            else:
                print(3)
        else:
            print(2)
    else:
        print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def devisor(n):
	devs = []
	for i in range(1,n+1):
		if i**2 > n:
			break
		if n % i == 0:
			devs.append(i)
			if i != n // i:
				devs.append(n//i)
	return devs

cnt = 0
for i in range(1,n+1):
	if i % 2 == 0:
		continue
	ndevs = len(devisor(i))
	if ndevs == 8:
		cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
inputs=[i for i in range(n+1) if i%2==1]

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)

ans=0
for i in inputs:
  if make_divisors(i)==8:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
from bisect import*;print("012345"[bisect([105,135,165,189,195],int(input()))])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
def factorize(N):
    up = int(np.sqrt(N))+2
    out = {}

    for i in range(2,up):
        if N%i == 0:
            temp = N
            count = 0
            while(True):
                N = N//i
                count += 1
                if N%i != 0:
                    break
            out[i] = count
        else:
            continue
    if N != 1:
        out[N] = 1
    return out

n = int(input())
ans = 0
for i in range(1,n+1,2):
    d = factorize(i)
    temp = 1
    for k in d:
        temp*=(d[k]+1)
    if temp == 8:
        ans += 1
    # 
    # print(d)
    # print(len(d)+1)
print(ans)

Submission status: Accepted

Solution code:
N=input()
N=int(N)
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
u=0
for i in range(N):
    a=make_divisors(i+1)
    if len(a)==8 and (i+1) % 2==1:
        u+=1

    

print(u)

Submission status: Accepted

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


if __name__ == "__main__":
    test()

Submission status: Accepted

Solution code:
def div(N):
    ans = []
    for i in range(1, int(N ** 0.5) + 1):
        if N % i == 0:
            ans.append(i)
            if N // i != i:
                ans.append(N // i)
    ans.sort()
    return ans


N = int(input())
ans = 0
for i in range(1, N + 1):
    if i % 2 == 1:
        di = []
        di = div(i)
        if len(di) == 8:
            ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
def yakusu(a):
    b = 1
    num = 0
    if a == 1:
        return 1
    while b<=a:
        if a%b == 0 and b%2 ==1:
            num += 1
        b += 1
    return num
    
li = []
for i in range(1,n+1):
    li.append(yakusu(i))

print(li.count(8))

Submission status: Accepted

Solution code:
N = int(input())

def find_divisor_num(n):
    count = 0
    i = 1
    while i**2 < n:
        if n % i == 0:
            count += 2
        i += 1
    if n == i**2:
        count += 1
    return count

count = 0
for i in range(1, N+1, 2):
    divisor_num = find_divisor_num(i)
    if divisor_num == 8:
        count += 1

print(count)

Submission status: Accepted

Solution code:
import math

def main():
    N = int(input())
    count = 0
    for m in range(1, N+1):
        if m % 2 == 1 and factors(m):
            count += 1
    return count

def factors(m):
    fs = set()
    for i in range(1, int(math.sqrt(m))+1):
        if m % i == 0:
            fs.add(i)
            fs.add(m // i)
    if len(fs) == 8:
        return True
    else:
        return False


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def primeFacter(x):
    i = 1
    cnt = 0
    while i <= 200:
        if x % i == 0:
            cnt +=1
        i += 1
    return cnt
n = int(input())
cnt = 0
for i in range(1,n+1,2):#1~n
    if primeFacter(i) == 8:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

mod = 1000000007

"""
# 標準入力取得
## 文字列
    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())

## 数値
    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

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


if __name__ == "__main__":
    N = int(sys.stdin.readline())
    ans = 0
    print(sum(count(x) == 8 for x in range(1, N + 1, 2)))

Submission status: Accepted

Solution code:
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

mod = 1000000007

"""
# 標準入力取得
## 文字列
    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())

## 数値
    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

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


if __name__ == "__main__":
    N = int(sys.stdin.readline())
    ans = 0
    for i in range(1, N + 1):
        if i % 2 != 0:
            if count(i) == 8:
                ans += 1
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(res_cnt)

Submission status: Accepted

Solution code:
n=int(input())
i=0
num_count=0
while(2*i+1<=n):
    count=0
    for k in range(1,(2*i+1)+1,2):
        if (2*i+1)%k==0:
            count+=1
    if count==8:
        num_count+=1
    i+=1
print(num_count)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n=int(input())

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())

ans = 0
for i in range(3,N+1):
    if i < 105:
        continue
    elif i%2 == 0:
        continue
    counter = 1
    n = math.floor(math.sqrt(i))
    for j in range(2,n+1):
        a = 0
        while i%j == 0:
            a += 1
            i /= j
        if a > 0:
            counter *= (a+1)
    if counter == 8:
        ans += 1
print(ans)

Submission status: Accepted

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