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

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

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

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

        return divisor_list

n = int(input())

ans = 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

print(nums_count)

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

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

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

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

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

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



print(count)

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

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

print(len(A))

Solution (Python):

N = int(input())

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

Solution (Python):

N = int(input())

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

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())
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):
import math
def count_div(n):
    ans=0
    u = int(math.sqrt(n))+1
    for i in range (1,u):
        if n%i==0:
            ans+=2
    return ans

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

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

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

Solution (Python):
















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

Solution (Python):
N = int(input())
odd = [i for i in range(N + 1) if i % 2 == 1]
ans = 0

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

print(ans)

Solution (Python):

import math

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

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

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

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

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

    print(counter)


if __name__ == "__main__":
    main()

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

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

Solution (Python):


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

Solution (Python):

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

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


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


if __name__ == '__main__':
    main()

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

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


print(con.count(8))

Solution (Python):
import sys
import math

N = int(input())

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

odd_num = 105
result = 0

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

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

print(result)

Solution (Python):





N = int(input())




ans_num = 0


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

print(ans_num)

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

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

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

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

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

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

if __name__ == "__main__":
    main()

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


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

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

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

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

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

print(ans)

Solution (Python):
import math

N = int(input())








def make_prime_list_2(num):
    if num < 2:
        return []

    
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0  
    num_sqrt = math.sqrt(num)

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

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

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


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

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

        if num != 1:
            divisor_num *= 2

        return divisor_num


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

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

Solution (Python):
import math
N=int(input())
ans=0
count=0
for n in range(1,N+1,2):
	count=0
	for factor in range(1,n+1,2):
		if n%factor == 0:
			count+=1
	if count == 8:
		ans+=1
print(ans)

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

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

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

Solution (Python):

N = int(input())

n = [i for i in range(1, N + 1)]
res = 0

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

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

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

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

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

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

Solution (Python):
a=int(input())
b=[]
for k in range(1,a+1):
	c=[]
	b.append(c)
	for i in range(a+1):
		if k%(2*i+1)==0:
			c.append(2*i+1)

d=0
for i in b:
	if len(i)==8:
		d=d+1
print(d)

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

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

print(count)

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

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

print(count)

Solution (Python):
N = int(input())
nice_yaku = []
for i in range(1,N+1) :
	if i % 2 == 0 :
		
		continue

	yaku = []
	for j in range(1,i+1) :
		if i % j == 0 :
			yaku.append(j)

	if len(yaku) == 8 :
		nice_yaku.append(i)

print(len(nice_yaku))

Solution (Python):
N = int(input())
yakusuu8 = [3**3 * 5, 3**3 * 7, 3*5*7, 3*5*11, 3*5*13]
cnt = 0
for i in yakusuu8:
    if(i<= N):
        cnt += 1

print(cnt)

Solution (Python):
N=int(input())
res=0
if(N>=105):
    pass
else:
    print(0)
    exit(0)

for i in range(105,N+1):
    
    counter=0
    if(i%2==0):
        pass
    else:
        for s in range(1,i+1):
            if(i%s==0):
                counter=counter+1

    if(counter==8):
        res=res+1
    
print(res)

Solution (Python):
N = int(input())
L = []

for j in range(1,201) :
    counter = 0
    if j % 2 != 0 :
        for i in range(1,N+1) :
            if j % i == 0 :
                counter += 1
        if counter == 8 :
            L.append(j)

p = 0
for i in L :
    if i <= N :
        p += 1
    else :
        break
print(p)

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

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

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

def count_d(n):
    ret = 0
    for d in range(1,n+1):
        if n%d == 0:
            ret += 1
    return ret

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

Solution (Python):
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()

ans = 0
for i in range(1,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):
def main():
    n = int(input())
    
    count = 0
    for i in range(1, n+1):
        d = 0
        if i % 2 == 0:
            continue;
        for j in range(1, int(i**(1/2))+1):
            if i % j == 0:
                d += 2
                if d > 8:
                    break
        if d == 8:
            count += 1
    print(count)

if __name__ == "__main__":
    main()

Solution (Python):
ret = 0
for x in range(1, int(input()) + 1, 2):
    tmp = 1
    for y in range(1, x):
        if x % y == 0:
            tmp += 1
    if tmp == 8:
        ret += 1
print(ret)

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

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

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
                break
print(ans)

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

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


ans=0
ns = [x for x in range(1,n+1) if x%2==1]
for j in ns:
	if yakusuu(j)==8:
		ans+=1

print(ans)

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

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

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

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

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

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

print(ans)

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

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

print(num)

Solution (Python):
N = 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=list([105,135,165,189,195])
a=l.count(n)
l.append(n)
l.sort()
print(l.index(n)+a)

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

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

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

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

print(cnt)

Solution (Python):
import sys
import string
input=sys.stdin.readline

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())
if(n<=104):
  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):
def main():
    n = int(input())
    s = 0

    for i in range(1, n + 1, 2):
        if num_factor(i) == 8:
            s += 1
    print(s)


def num_factor(n):
    if n == 1:
        return 1

    s = 2
    i = 2

    while i * i <= n:
        if n % i == 0:
            if i * i != n:
                s += 2
            else:
                s += 1
        i += 1
    return s

main()

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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


if __name__ == '__main__':
    main()

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

count = 0
c = 0

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

print(c)

Solution (Python):
def _105(n):
    b = 0
    for i in range(105, n + 1, 2):
        ii = i
        l = []
        for j in range(2, i + 1):
            while True:
                if ii % j == 0:
                    l += [j]
                    ii /= j
                else:
                    break
        if len(l) == 3:
            if len(set(l)) == 3:
                b += 1
        if len(l) == 4:
            if len(set(l)) == 2:
                l.remove(set(l).pop())
                if len(l) == 3 or len(l) == 1:
                    b += 1
    return b

print(_105(int(input())))

Solution (Python):
d=[105,3*5*9,3*5*11,3*5*5*5,27*7,15*13]
n=int(input())
ans=0
for i in range(len(d)):
  if d[i]<=n:
    ans+=1
print(ans)

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

Solution (Python):
def factorize(n):
  factors=[1]
  i=2
  while n>1:
    if n%i==0:
      factors.append(i)
    if i==n:
      break
    else:
      i+=1
  return factors
      
n=int(input())
nums=[]
for i in range(1,n+1):
  if i%2==1:
    if len(factorize(i))==8:
      nums.append(i)
print(len(nums))

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


def getDiv(n):
    count = 0
    for i in range(2, n // 2 + 1):
        if n % i == 0:
            count += 1
            
    return count


count = 0
for i in range(1, N + 1):
    if (i % 2 != 0) and (getDiv(i) == 8-2):
        count += 1

print(count)

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

result=0 

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

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

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

print(result)

Solution (Python):
N = int(input())
x = [i for i in range(1,N+1) if i%2!=0]
z = []
for i in x:
  y = 0
  for j in range(1,N+1):
    if i % j == 0:
      y += 1
  if y == 8:
    z.append(i)
print(len(z))

Solution (Python):
N = int(input())
countK = 0
for i in range(1,N+1):
    countY = 0
    if i%2 == 1:
        for j in range(1,i+1):
            if i%j == 0:
                countY += 1
        if countY==8:
            countK += 1        
    else:
        continue
print(countK)

Solution (Python):

n = int(input())
a = 0
for i in range(1, n+1)[0::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):
import collections

N = int(input())
count = 0

for k in range(1,N+1):
    
    num = []
    n = k
    if(n % 2 == 0):
        continue

    for i in range(2,k+1):
        if n % i == 0:
            n = int(n // i)
            num.append(i)


    num_counter = collections.Counter(num)
    ans = 1
    for value in num_counter.values():
        ans *= value+1

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



print(count)

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):
    k = 0
    for j in range(1, int(i**0.5 + 1)):
        if i % j == 0:
            k += 1
    if k == 4:
        ans += 1
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):
n=int(input())
if n<105:print(0)
elif n<3*5*9:print(1)
elif n<3*5*11:print(2)
elif n<3*7*9:print(3)
elif n<3*5*13:print(4)
else:print(5)

Solution (Python):
import math
from collections import deque



def make_prime_list(num):
    if num < 2:
        return []

    prime_list = [i for i in range(num+1)]
    prime_list[1] = 0
    num_sqrt = math.sqrt(num)

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

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




def prime_factorization(num):
    if num <= 1:
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list(num_sqrt)

        dict_counter = {}
        for prime in prime_list:
            while num % prime == 0:
                if prime in dict_counter:
                    dict_counter[prime] += 1
                else:
                    dict_counter[prime] = 1
                num //= prime
        
        if num != 1:
            if num in dict_counter:
                dict_counter[num] += 1
            else:
                dict_counter[num] = 1

        return dict_counter




def search_divisor_num(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        divisor_num = 1
        dict_fact = prime_factorization(num)
        for value in dict_fact.values():
            divisor_num *= (value + 1)
        return divisor_num


n = int(input())
res = [num for num in range(1,n+1,2) if search_divisor_num(num) == 8]
print(len(res))

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

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= int(i)
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(n)
  return table

a = [1]*(n+1)
for i in range(3,n+1,2):
    il = prime_decomposition(i)
    il_unique = list(set(il))
    ans = 1
    for j in il_unique:
        ans *= (il.count(j)+1)
    a[i] = max(a[i],ans)


print(a.count(8))

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

divisor = 0

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

print(divisor)

Solution (Python):


n  = int(input())

def pcheck(num):
  
  nd=1
  if num>1:
    nd=2
  for i in range(2,num):
    if num%i==0:
      nd=nd+1
  return nd==8

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

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

Solution (Python):
n=int(input())
l=0
for i in range(1,n+1):
  if i%2==1:    
    p=0
    for k in range(1,i+1):
      if i%k==0:
        p+=1
    if p==8:
      l+=1
print(l)

Solution (Python):
n=int(input())
l=[]
for i in range(1,n+1):
  if i%2==1:    
    p=0
    for k in range(1,i+1):
      if i%k==0:
        p+=1
    if p==8:
      l.append(i)
print(len(l))

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

Solution (Python):
n = int(input())
if not n%2:
    n -= 1

result = 0

for i in range(1,n+2,2):
    cnt = 0

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

    if cnt >= 8:
        result += 1

print(result)

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

Solution (Python):
N = int(input())
odd = list(range(1, N+1, 2))
ans = 0

for ki in odd:
    count = 0
    for waru in range(1,ki+1):
        if ki % waru == 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):
    co = 0
    for f in range(1,i+1):
        if i % f == 0:
            co += 1
    if co == 8:
        ans += 1
print(ans)

Solution (Python):
n = int(input())
ans = 0
for i in range(1,n//2-2):
  a = i * 2 + 1
  for j in range(i+1,n//2-1):
    b = j * 2 + 1
    for k in range(j+1,n//2):
      c = k * 2 + 1
      if a*b*c <= n : ans += 1
      else: break
print(ans)

Solution (Python):
n=int(input())
ans=0
def cou(n):
  tmp=2
  for i in range(2,n):
    if n%i==0:
      tmp+=1
  return tmp
for i in range(1,n+1,2):
  if cou(i)==8:
    ans+=1
print(ans)

Solution (Python):
N=int(input())
num=0
for i in range(N+1)[1::2]:
	able=1
	for j in range((N//2)+1)[1:]:
		if i%j==0:
			able+=1
	if able==8:
		num+=1
print(num)

Solution (Python):
N = int(input())
count = 0
for num in range(1, N+1):
    result = []
    if num % 2 != 0:
        for n in range(1, num+1):
            if num % n == 0:
                result.append(n)

    if len(result) == 8:
        count += 1

print(count)