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

n_eight_devisor = 0
for odd in odds:
    n_divisor = 0
    # Count number of divisor
    for i in range(1, odd+1):
        if odd % i == 0:
            n_divisor += 1
    if n_divisor == 8:
        n_eight_devisor += 1

print(n_eight_devisor)

Submission status: Accepted

Solution code:
from array import array
from itertools import islice, repeat


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

    divisor_count_of = array('B', repeat(2, number + 1))
    for i in range(2, number // 2 + 1):
        for j in range(i * 2, number + 1, i):
            divisor_count_of[j] += 1

    print(sum(1 for divisor_count in islice(
        divisor_count_of, 1, None, 2) if divisor_count == 8))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(raw_input())

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

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

Submission status: Accepted

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

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

for i in range(1,N+1,2):

    if len(ifdivisor(i)) == 8:
        y8 = y8 + 1

print(y8)

Submission status: Accepted

Solution code:
N = int(input())

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

print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def func():
    N = int(input())
    if(N < 105):
        print(0)
        return

    prime = []
    isPrime = [True for i in range(201)]
    isPrime[0] = isPrime[1] = False
    for i in range(2, 201):
        if(isPrime[i]):
            prime.append(i)
            for j in range(2 * i, 201, i):
                isPrime[j] = False

    ans = 0
    for a in range(105, N + 1, 2):
        cnt = []
        num = a
        for i in range(len(prime)):
            divCnt = 0
            while(num % prime[i] == 0):
                num //= prime[i]
                divCnt += 1
            if(divCnt > 0):
                cnt.append(divCnt)
        divisorCnt = 1
        for i in range(len(cnt)):
            divisorCnt *= cnt[i] + 1
        if(divisorCnt == 8):
            ans += 1
    print(ans)

if __name__ == '__main__':
    func()

Submission status: Accepted

Solution code:
N=int(input())
div=0
A=0
B=N
count=0
answer=0
for i in range(1,N+1,2):
  div=0
  count=0
  while True:
    div+=1
    if i%div==0:
      A=div
      B=i/div
      if A<B:
        count+=1
    if A>=B:
      if count==4:
        answer+=1  
      break
print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

t = 0

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

    if k == 8:
        t += 1

print(t)

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())
odd_8 = [0,105,135,165,189,195,201]
for i in range(6):
    if odd_8[i] <= N < odd_8[i+1]:
        print(i)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
import math

def soin(n):
    ret = 1
    for i in range(2, int(math.sqrt(n)) + 1):
        x = 0
        while n % i == 0:
            n /= i
            x += 1
        ret *= x + 1
    return 2 if ret == 1 else ret

N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

a = [0] * 201

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

  if count == 8 and i % 2 == 1:
    a[i] = a[i-1] + 1
  else:
    a[i] = a[i-1]


print(a[N])

Submission status: Accepted

Solution code:
n=int(input())
x=0
for i in range(1,n+1,2):
  c=0
  for j in range(1,n//2+1):
    if(i%j==0):c+=1
  if(c==7):x+=1
print(x)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve(x):
	res = 0
	for i in xrange(1,x+1):
		if x%i == 0:
			res += 1
	return res

n = input()
ans = 0
for i in xrange(1,n+1):
	if solve(i) == 8 and i&1:
		ans += 1
print ans

Submission status: Accepted

Solution code:
y = input().split()
y = int(y[0]) + 1
num = 0
for i in range(y):
    if (i%2):
        syou = 0
        for j in range(i):
            if not (i % (j+1)):
                syou = syou + 1
        if syou == 8:
            num = num + 1
print(num)

Submission status: Accepted

Solution code:
k = [104,134,164,188,194]
n = int(input())
k.append(n)
print(sorted(k).index(n))

Submission status: Accepted

Solution code:
n =  int(input())

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

print(cnt_eight)

Submission status: Accepted

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

N = int(input())

for i,p in enumerate(P):
  if N < p:
    print(i)
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(num):
  count = 0
  primes = [3,5,7,11,13]
  
  
  for j in range(1,num+1):
    factors = 1
    primelist =[1,1,1,1,1]
    for i in range(len(primelist)):
      while j%primes[i] == 0:
        primelist[i] += 1
        j = int(j/primes[i])
    for li in primelist:
      factors *= li
    if factors ==8:
      count += 1
      
    
  return count

print(main(int(input())))

Submission status: Accepted

Solution code:
b_size = {}
for b in range(1, int(input())+1):
  if b%2 == 0:
    continue
  size = len([by for by in range(1, b+1) if b%by == 0 and by%2 == 1])
  if size == 8:
    b_size[b] = size
print(len(b_size))

Submission status: Accepted

Solution code:
N = int(input())

def hoge(N):
    count = 0
    judge = False
    for i in range(1, N+1, 2):
        if N % i == 0:
            count += 1

    if count == 8:
        judge = True

    return judge

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


print ("%d" % count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = float(input())
t = 3
prime_number = []
while t <= N / 15.0:
    l = []
    for i in range(t+1):
        if i != 0:
            if t % i == 0:
                l.append(i)
    if l == [1, t]:
        prime_number.append(t)
    t += 1
n = len(prime_number)
ans = 0
if n < 3:
    print(0)
    sys.exit()
else:
    for i in prime_number:
        for j in prime_number:
            if j != i:
                for k in prime_number:
                    if k != i and k != j:
                        if i * j * k <= N:
                            ans += 1
ans = ans / 6
if N >= 189:
    ans += 2
elif N >= 135:
    ans += 1
print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
if N<105:
    print(0)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
if N >= 105:
    cnt += 1
    for i in range(106, N + 1):
        cnt8 = 0
        if i % 2 == 0:
            continue

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

Submission status: Accepted

Solution code:
N = int(input())

d = [0] + [1] * N
for n in range(3, N+1, 2):
    for i in range(n, N+1, n):
        d[i] += 1

ans = 0
for di in d:
    if di == 8:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
N_odds=[]
for i in range(105,N+1):
    if i%2==1 :
        N_odds.append(i)
    else:
        continue
eights=[105,135,165,189,195]
answers=[]
for i in N_odds:
    if i in eights:
        answers.append(i)
    else:
        continue
print(len(answers))

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(1, N+1):
    if i % 2 == 0: continue
    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:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

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

Submission status: Accepted

Solution code:
n = int(input())
ans = [0] * n
for i in range(1,n+1):
    j = i-1
    while j < n:
        ans[j] += 1
        j += i
k = 0
for i in range(0,n,2):
    if ans[i] == 8:
        k += 1
print(str(k))

Submission status: Accepted

Solution code:
i=105
N=input()
N=int(N)
m=5
n=0
x=0
y=0
while i <= N:
  if i % 2 != 0:
    if i % 3 == 0:
      n = int(i / 3)
      while m < n:
        if i % m == 0:
          x = x + 1
        m=m+2
      if x == 4:
        y = y + 1
  x=0
  n=0
  m=5
  i = i + 1
print(y)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
a = [0] * 201
a[105] = a[135] = a[165] = a[189] = a[195] = 1
for i in range(201):
    a[i] += a[i - 1]
print(a[N])

Submission status: Accepted

Solution code:
a=int(input())
b=0
for i in range(a):
    c=0
    if (i+1)%2==1:
        for j in range(a):
            if (i+1)%(j+1)==0:
                c+=1
    if c==8:
        b+=1

print(b)

Submission status: Accepted

Solution code:
def f(n):
    return len([x for x in range(1, n+1) if (n % x == 0)])

def solve(n):
    return len([x for x in range(105, n+1) if (x % 2 == 1) and (f(x) == 8)])

assert solve(105) == 1
assert solve(7) == 0
print solve(input())

Submission status: Accepted

Solution code:
#106b
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())
a = 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:
        a+=1

print(a)

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())
count = 0
count2 = 0

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

Submission status: Accepted

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

for x in range(1, n + 1, 2):
    if sum(1 for y in range(1, x // 2) if x % y == 0) == 7:
        c += 1

print(c)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(a)

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:

# 値を渡すと約数の個数が返される
# num >= 2 であることは保障されている
def make_divisor_num(num):
    d_list = [1]
    for i in range(2, num // 2 + 1):
        if num % i == 0:
            d_list.append(i)
    d_list.append(num)
    return len(d_list)


N = int(input())
if N < 105:
    print(0)
    exit()


counter = 0
for num in range(105, N+1, 2):
    if make_divisor_num(num) == 8:
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
def get_prime_num_list(n):
  if n < 3:
    return []
  result_list = []
  current_num = 3
  while current_num <= n:
    prime_flg = True
    for i in result_list:
      if current_num % i == 0:
        prime_flg = False
        break
    if prime_flg:
      result_list.append(current_num)
    current_num += 2
  return result_list

input_num = int(input())
prime_num_list = get_prime_num_list(input_num)

def divisor_count(n):
  tmp_num = n
  result_val = 1
  for prime_num in prime_num_list:
    prime_count = 0
    while tmp_num % prime_num == 0:
      prime_count += 1
      tmp_num //= prime_num
    result_val *= prime_count + 1
  return result_val
  
if input_num < 105:
  print(0)
else:
  num = 105
  result_count = 0
  while num <= input_num:
    if divisor_count(num) == 8:
      result_count += 1
    num += 2
  print(result_count)

Submission status: Accepted

Solution code:
N = int(input())

total = 0
for num in range(1, N + 1):
    if num % 2 == 0:
        continue
    divisors = 0
    for i in range(1, num + 1):
        if num % (i + 1) == 0:
            num = num / (i + 1)
            divisors += 1
    if divisors == 3:
        total += 1

print(total)

Submission status: Accepted

Solution code:
def main8():
    buf = int(input(""));
    result = 0;
    for i in range(buf):
        n = i + 1;
        if n % 2 == 1:
            kari = 0;
            for j in range(n):
                m = j + 1;
                if n % m == 0:
                    kari = kari + 1;
            if kari == 8:
                result = result + 1;
    print(result);

if __name__ == '__main__':
    main8()

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())
if N<105:
    print(0)
else:
    ans = 0
    for i in range(105, N+1):
        if i%2 == 0:
            continue
        else:
            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 x in range(1,N+1):
    if x%2 == 0:
        continue
    divider = 0
    for i in range(1,x+1):
        if x%i == 0:
            divider += 1
    if divider == 8:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
def koh(N):
    y = N
    p = 1
    c = 0
    while p <= N:
        if y % p == 0:
            c += 1
        p += 1
    if c == 0:
        c = 1
    return c
M = int(input())
output = 0
for i in range(3, M + 1, 2):
    if koh(i) == 8:
        output += 1
print(output)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

res = 0

for i in range(N+1)[1::2]:
    div = 0
    for j in range(i+1)[1:]:
        if i % j == 0:
            div += 1
    if div == 8:
        res += 1

print(res)

Submission status: Accepted

Solution code:
# coding:utf-8

INF = float('inf')
def inpl(): return list(map(int, input().split()))


n = int(input())

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

    if count == 8:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
odd_numbers = [i for i in range(1, N + 1) if i % 2 == 1]

def count_divisor(number):
    divisor = 0
    for i in range(1, number + 1):
        if number % i == 0:
            divisor += 1
    return divisor 

def main():
    count = 0
    for i in odd_numbers:
        if count_divisor(i) == 8:
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
n = int(input())

#条件満たす数カウント
cn = 0
#約数カウント
cy = 0

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

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

    for j in range(1, i+1):
        if i % j == 0:
            cy += 1
    if cy == 8:
        cn += 1
    cy = 0
print(cn)

Submission status: Accepted

Solution code:
#abc106b
import sys

n=int(raw_input())
res=0
for i in xrange(1,n+1):
 cnt=0
 for j in xrange(1,i+1,2):
  if i%j==0:
   cnt+=1
 if cnt==8:
  res+=1
print res

Submission status: Accepted

Solution code:
N = int(input())

def ndiv(n):
    '''The number of positive divisors of n.'''
    return sum(1 for d in range(1, n+1) if n % d == 0)

count = sum(1 for i in range(1, N+1, 2) if ndiv(i) == 8)
print(count)

Submission status: Accepted

Solution code:
n = int(input())

counter_outer = 0

for i in range(1, n+1, 2):
 counter_inner = 0
 for j in range(1, int(i**0.5) + 1):
     if i%j == 0:
       counter_inner += 1
 if(counter_inner == 4):
   counter_outer += 1

print(counter_outer)

Submission status: Accepted

Solution code:
a = int(input())
ans = 0
if a >= 105:
    ans+=1
if a >= 135:
    ans+=1
if a >= 165:
    ans+=1
if a >= 189:
    ans+=1
if a >= 195:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
n = int(input())

#条件満たす数カウント
cn = 0
#約数カウント
cy = 0

if n < 105:
    print(0)
    sys.exit()
    
for i in range(105, n+1):
    if i % 2 == 0:
        continue

    for j in range(1, i+1):
        if i % j == 0:
            cy += 1
    if cy == 8:
        cn += 1
    cy = 0
print(cn)

Submission status: Accepted

Solution code:
print([[i%j for j in range(2,i)].count(0) for i in range(1,int(input())+1,2)].count(6))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
divs = [1]*(n + 1)
for i in range(3, n + 1, 2):
    for j in range(3, n + 1, 2):
        if i % j == 0:
            divs[i] = divs[i] + 1

print(len([x for x in range(len(divs)) if divs[x] == 8]))

Submission status: Accepted

Solution code:
# coding: utf-8


def main():
    n = int(input())
    count = 0

    for num in range(1, n + 1, 2):
        d_count = 0
        for divnum in range(1, num + 1):
            if num % divnum == 0:
                d_count += 1

        if d_count == 8:
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

n = int(raw_input())
ans = 0
for i in range(0, 5):
	if lst[i] <= n: ans = ans + 1

print ans

Submission status: Accepted

Solution code:
print([[i%j for j in range(1,i)].count(0) for i in range(1,int(input())+1,2)].count(7))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

prime = [3, 5, 7, 11, 13]

# 約数が8個ということは、素因数分解した時の素因数の個数が0/7, 1/3, 1/1/1以外ありえない
zero_seven = 0
one_three = [a * (b ** 3) for a in prime for b in prime if a != b]
one_three = [i for i in one_three if i <= 200]
one_one_one = [a * b * c for a in prime for b in prime for c in prime
               if a != b and b != c and c != a]
one_one_one = [i for i in one_one_one if i <= 200]

ans = sorted(set(one_three + one_one_one))
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)
elif 195 <= N:
    print(5)

Submission status: Accepted

Solution code:
N = int(input())

yaks = []

for i in range(1, N + 1) :
    cnt = 0
    
    for j in range(1, i) :
        if i % j == 0 :
            cnt += 1
            
    if cnt == 7 and i % 2 != 0:
        yaks.append(i)

print(len(yaks))

Submission status: Accepted

Solution code:
n = int(input())
m =  [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5]

print(m[n - 1])

Submission status: Accepted

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

for num in range(1, N+1, 2):
    divisor = 0
    for devide in range(1, N+1, 2):
        if num % devide == 0:
            divisor += 1
        if divisor > 8:
            break
    if divisor == 8:
        ans += 1

print(ans)

Submission status: Accepted

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



if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def divlist(n):
    if n < 1:
        return []
    elif n == 1:
        return [1]
    else:
        div = [1]
        for i in range(2, n + 1):
            if n % i == 0:
                div.append(i)
        return div


ans = []

for i in range(1,N+1):
    if i % 2 == 0:
        pass
    elif len(divlist(i)) == 8:
        ans.append(i)

print(len(ans))

Submission status: Accepted

Solution code:
n=int(input())
c=0
for i in range(1,n+1):
    m=0
    for j in range(1,i+1):m+=i%j<1
    c+=m==i%2*8
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

num = int(n)
kisu_array = []
yakusuu_array = []
kazu_list = 0
for i in range(1,num+1):
    if i%2 != 0:
        kisu_array.append(i)

for i in kisu_array:
    for j in range(1,i+1):
        if i% j == 0:
            yakusuu_array += "1"

            if len(yakusuu_array) == 8:
                kazu_list += 1
    yakusuu_array = []
                
print(kazu_list)

Submission status: Accepted

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

def factors(n):
    return sum(0 == n % (1 + x) for x in range(N))
print(sum(map(lambda x: factors(x) == 8, range(105, N+1, 2))))

Submission status: Accepted

Solution code:
# coding: utf-8

# 条件を満たす数字は、以下のいずれか(a,b,cは2を除く素数)
# typeA: a*b*c
# typeA: a*b^3
# typeA: a^7
# それぞれの場合に、どの素数まで考慮すればよいか
# 素数：2, 3, 5, 7, 11, 13, 17, 19,...
# typeA: 3*5*13<200<3*5*17なので、[3,5,7,11,13]で考えればよい。
# typeB: 3^3*7<200<3^3*11なので、[3,5,7,11]で考えればよい。
# typeC: 200<3^7なので、考えなくてよい。

p = [3,5,7,11,13]
import itertools
import numpy

typeA = list(map(list,list(itertools.combinations(p,3))))
for i in range(len(typeA)):
    typeA[i] = typeA[i][0]*typeA[i][1]*typeA[i][2]

typeB = list(map(list,list(itertools.permutations(p,2))))
for i in range(len(typeB)):
    typeB[i] = typeB[i][0]*typeB[i][1]**3

specialnumbers = typeA + typeB

n = int(input())
print(len(list(filter(lambda x : x <= n, specialnumbers ))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def uo(x):
    if x == 1:
        return 1
    else:
        uouo = []
        uouo.append(1)
        for i in range(2,x//2+1):
            if x % i == 0:
                uouo.append(i)
        uouo.append(x)

        return len(uouo)

a = 0

for i in [i for i in range(int(input())+1)]:
    if i % 2 == 1 and uo(i) == 8:
        a += 1

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
result = 0
for i in range(0, a):
    tmp = 0
    if (i+1) % 2 != 0:
        for j in range(0, i):
            if (i + 1) % (j + 1) == 0:
                tmp += 1
        if tmp == 7:
            result += 1

print(result)

Submission status: Accepted

Solution code:
import math

N = int(input())

ans = 0

def cal(n):
    limit = math.floor(math.sqrt(n))
    count = 0
    for i in range(1, limit+1):
        if n % i == 0:
            if n % i == i:
                count += 1
            else:
                count += 2
    return count

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)