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.

Solution (Python):
N = int(input())
ans = 0
c = 0

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

Solution (Python):
n = int(input())

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

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

print(cnt)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
N = int(input())


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

Solution (Python):
n=int(input())
c=0
for i in range(1,n+1):
    if not i%2:continue
    t=0
    for j in range(1,i+1):
        if not i%j:t+=1
    if t==8:c+=1
print(c)

Solution (Python):
n = int(input())


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

        return divisor_list


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

Solution (Python):
N = int(input())
num = 0
for i in range(1, N + 1, 2):
    rec = 0
    for j in range(1, i + 1):
        if i % j == 0:
            rec += 1
    if rec == 8:
        num += 1

print(num)

Solution (Python):


N = int(input())

if N <= 104:
  print("0")
elif N <= 134:
  print("1")
elif N <= 164:
  print("2")
elif N <= 188:
  print("3")
elif N <= 194:
  print("4")
else:
  print("5")

Solution (Python):
import numpy as np
N=int(input())

arr=np.array([0 for _ in range((N+1)//2)])
num=np.array([2*i+1 for i in range((N+1)//2)])
for i in range(1,N+1):
    arr[num%i==0]+=1
print(len(arr[arr==8]))

Solution (Python):
N = int(input())
x = 1
count = 0

while x <= N:
  a = 0
  k = 1
  while k <= x:
    if x%k == 0:
      a += 1
    k += 2
  if a == 8:
    count += 1
  x += 2

print(count)

Solution (Python):
n = int(input())

ans = []
for odd in range(1, n+1):
    if odd % 2 == 0: continue
    cnt = 0
    for j in range(1, odd+1):
        if odd % j == 0:
            cnt += 1
    if cnt == 8:
        ans.append(odd)
print(len(ans))

Solution (Python):

N = int(input())


def check(n):
    v = list(filter(lambda x: n % x == 0, range(1, n + 1)))
    return len(v) == 8


print(len(list(filter(check, range(1, N + 1, 2)))))

Solution (Python):

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

Solution (Python):
n = int(input())
prime = [2,3,5,7,11,13]
dist_list = list((0,0,0,0,0,0))
ans_count = 0
count_origin = 1
prime_count = 0
while count_origin<= n:
  if count_origin % 2 == 0:
    count_origin += 1
    continue
  count = count_origin 
  while prime_count < 6:
    while count % prime[prime_count] == 0:
      count /= prime[prime_count]
      dist_list[prime_count] += 1
    prime_count += 1
  prime_count = 0
  result = 1
  for number in dist_list:
    result *= (number+1)
  if result == 8:
    ans_count += 1
  dist_list = list((0,0,0,0,0,0))
  count_origin += 1
print(ans_count)

Solution (Python):
n = int(input())

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

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

Solution (Python):
N = int(input())
count = 0

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

        if cnt == 8:
            count += 1

print(count)

Solution (Python):
n = int(input())
answer = 0
for i in range(1, n+1, 2):
    num_of_divisor = 0
    for j in range(1, i+1):
        if i % j == 0:
            num_of_divisor += 1
    if num_of_divisor == 8:
        answer += 1
print(answer)

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

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

print(ans)

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

Solution (Python):
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)

Solution (Python):
N = int(input())
ret = 0

for n in range(1,N+1):
    a=1
    b=1
    c=1
    d=1
    e=1
    f=1
    z=1
    while n % 2 == 0:
        z=0
        n /= 2

    while n % 3 ==0:
        n /= 3
        a +=1
        
    while n % 5 ==0:
        n /= 5
        b +=1
        
    while n % 7 ==0:
        n /= 7
        c +=1
        
    while n % 11 ==0:
        n /= 11
        d +=1
        
    while n % 13 ==0:
        n /= 13
        e +=1
        
    if n > 1:
        f=2
        
    if z*a*b*c*d*e*f == 8:
        ret +=1

    
print (ret)

Solution (Python):
n = int(input())
lines = [i for i in range(24, n+1) if i % 2 != 0]

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

Solution (Python):
N=int(input())
i=1

yakusu=0
while i<=N:
	j=1
	k=0
	
	while j<=i:
		if i%j==0:
			k=k+1
		j=j+1	
		if k==8:
			yakusu=yakusu+1
	i=i+2
print(yakusu)

Solution (Python):
"""
B - 105
1 以上 N 以下の奇数のうち, 正の約数を ちょうど 8 個持つようなものの個数を求めよ. 
"""
N = int(input())

cnt = 0
for n in range(1, N+1, 2):
    yaku = 2
    for test in range(3, int(n ** 0.5) + 1, 2):
        
        
        if (n % test) == 0:
            yaku += 2

    
    if yaku == 8:
        cnt += 1

print(cnt)

Solution (Python):

n = int(input())
ls_odd = [i for i in range(1,n+1,2)]
cnt = 0
for odd in ls_odd:
    ls_div = [odd % (i+1) == 0 for i in range(odd)]
    if sum(ls_div) == 8:
        cnt += 1
print (cnt)

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

Solution (Python):
divisors_8 = [105]

for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)
divisors_8.remove(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)

Solution (Python):
def main():
	n = int(input())

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


if __name__ == '__main__':
	main()

Solution (Python):
n = int(input())

l = [3, 5, 7, 11, 13]
ans = []
for i in range(len(l)):
    for j in range(len(l)):
        if j <= i:
            continue
        ans.append(l[i]**3 * l[j])
        ans.append(l[j]**3 * l[i])
        for k in range(len(l)):   
            if k <= j:
                continue 
            ans.append(l[i]*l[j]*l[k])
a = sum([1 if tmp <= n else 0 for tmp in ans])
print(a)

Solution (Python):
import sys


def solve(n):
    listc = []
    for i in range(1,201):
        lista = []
        for j in range(1,201):
            if i%j == 0:
                lista.append(j)
        if len(lista) >= 8 and lista[-1] %2 != 0:
            listc.append(lista[-1])
    
    for i in range(len(listc)):
        if n < listc[0]:
            return 0
        elif n >= listc[-(i+1)]:
            return len(listc)-i


def readQuestion():
    line = sys.stdin.readline().rstrip()
    return int(line)

def main():
    n = readQuestion()
    answer = solve(n)
    print(answer)
if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
index=1
count=0
while index<n+1:
    count2=0
    index2=1
    while index2<index+1:
        if index%index2==0:
            count2+=1
        index2+=1
    if count2==8:
        count+=1
    index+=2

print(count)

Solution (Python):
if __name__ == '__main__':
    
    N = int(input())
    n = 0
    for i in range(3,N+1,2):
        k = 1
        for j in range(2,i+1):
            if i % j == 0:
                k += 1
            if k > 8:
                break
        if k == 8:
            n += 1
    print(n)

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

print(ans)

Solution (Python):
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)

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

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

Solution (Python):
import bisect
ans = [105, 135, 165, 189, 195]
n = int(input())
print(bisect.bisect_right(ans,n))

Solution (Python):
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)

Solution (Python):


n = int(input())

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

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

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

print(ans)

Solution (Python):

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)

Solution (Python):
N = int(input())
l = [105,135,165,189,195]
l.append(N+1)
l.sort()
print(l.index(N+1))

Solution (Python):
def countYakusu(N):
    count = 1
    for i in range(2, N + 1):
        count += [0,1][N % i == 0]
    return count

def NumOfYaku(num):
    ret_count = 0
    for j in range(1, num + 1, 2):
        if countYakusu(j) == 8:
            ret_count += 1
    return ret_count


if __name__ == '__main__':
    N = int(input())
    print(NumOfYaku(N))

Solution (Python):
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
    
    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)

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

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)

Solution (Python):
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])

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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

Solution (Python):
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)

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

Solution (Python):
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)

Solution (Python):
P = [105, 135, 165, 189, 195, 201]

N = int(input())

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

Solution (Python):
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)

Solution (Python):
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())))

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
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())

Solution (Python):

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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
N = int(input())
count = 0
count2 = 0

for i in range(N):
	count = 0
	
	if (i + 1) % 2 == 1:
		
		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(count2)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):



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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):


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)

Solution (Python):
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)

Solution (Python):
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]))

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)