peterverebics/CodeNet_Python_118 huggingface dataset:
N,x = map(int,input().split())
a = list(map(int,input().split()))
count = 0
#昇順に並べ替える
# sort_a = sorted(a)
a.sort(reverse=False)
for i in range(N):
    if x >= a[i]:
        count += 1
        x -= a[i]
    else:
        break
    print(count)

if (x!=0)and(count == N):
    count -= 1
    print(count)
n, x = map(int, input().split())
l = sorted(list(map(int, input().split())))
if sum(l) <= x:
    print(n)
else:
    for i in range(n):
        if x <= l[i]:
            break
        x -= l[i]
    print(i)
N, x = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
while len(a) != 0:
    next = min(a)
    a.remove(min(a))
    if x < next:
        break
    x -= next
    cnt += 1

print(cnt if x == 0 else cnt-1)
#!/usr/bin/env python

n, x = map(int, input().split())
a = list(map(int, input().split()))

a = sorted(a)
if x == sum(a):
    print(n)
    exit()
if x > sum(a):
    print(n-1)
    exit()
if x < min(a):
    print(0)
    exit()

ans = 0 
tmp = n 
while tmp >= 0:
    tmp -= a[ans]
    ans += 1

print(ans)
# A - Candy Distribution Again
N,x = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
tmp = 0
ans = 0
for a in A:
    tmp += a
    if tmp<=x:
        ans += 1
    else:
        break
print(ans)
N,x=map(int,input().split())
a = list(map(int,input().split()))
a.sort()
ans=0


if sum(a)<x:
    print(N-1)
else:
    for i in range(len(a)):
        if x>=a[i]:
            x -= a[i]
            ans += 1
        else:
            break
print(ans)
N, x = map(int, input().split())
a = list(map(int, input().split()))

ans = 0
a.sort()
a_sum = [sum(a[:i+1]) for i in range(len(a))]

for i, item in enumerate(a_sum):
    if x < item:
        ans = i
        break
    elif x == item:
        ans = i+1
    elif x > item and i == len(a_sum):
        ans = i-1

print(ans)
N, x = map(int, input().split())
a = list(map(int, input().split()))

a.sort()

count = 0

for v in a:
    if v <= x:
        count +=1
        x -= v
if x != 0:
    count = count - 1

print(count)
N, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
count = 0

for i in a:
  if x - i >= 0:
    x -= i
    count += 1
if x > 0:
  count -= 1
print(count)
import sys
N, x = map(int, input().split())
a = sorted(map(int, input().split()))


ans = 0
score_x  = x

if score_x < a[0]:
    print(0)
    sys.exit()
    
for  i in range(N):

    if score_x  >= a[i]:
        score_x = (score_x - a[i])
        ans = ans + 1


print(ans)
n,x=[int(x) for x in input().split()]
a=[int(x) for x in input().split()]

a.sort()
ans=n
s=0
for i in range(n):
    if s>x:
        ans=i
        break
    else:
        s=s+a[i]
if s<x:
    print(ans-1)
else:
    print(ans)
n,x,*a=map(int, open(0).read().split())
a.sort()
i=0
while 0<x:
    x-=a[i]
    if i<~-n:i+=1
    else:break
print(i)
N, x = map(int,input().split())
a = list(map(int,input().split()))
count = 0
a_new = sorted(a)

for i in range(0, N):
	x -= a_new[i]
	if x < 0:
		index = i - 1
		break
	if x == 0:
		index = i + 1
		break
	index = i

if index < 0:
	index = 0

print(str(index))
N, x = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)

sum = 0
ans = 0
for i in range(len(a)):
    sum += a[i]
    if x >= sum:
        ans += 1
    else:
        break
print(ans)
N, x = map(int, input().split())
a = list(map(int, input().split()))
candies = 0
over = 0
for i in a:
    candies += i
    if x < i:
        over += 1

if candies == x:  # 全員満足
    print(N)
    exit()
elif over == len(a):  # 全員不満足
    print(0)
    exit()
elif candies < x:
    print(N - 1)
    exit()
else:
    print(N - over)
    exit()
N, x = map(int, input().split())
arr = sorted(list(map(int, input().split())))
ans = 0
for i in range(N):
    if x >= arr[i]:
        x -= arr[i]
        ans += 1
    else:
        break
print(max(ans,0))
N,x=map(int, input().split())
A=sorted(list(map(int, input().split())))
cnt=0
for i in A:
  if i == A[-1] and x > i:
    break
  if x >= i:
    x -= i
    cnt+=1
  else:
    break
print(cnt)
N, x = map(int, input().split())
list_a = [int(x) for x in input().split()]

list_a.sort()
total = sum(list_a)
if x < list_a[0] :
    print(0)
    exit()

ans = 0

for i in range(N) :
    if list_a[i] <= x :
        x -= list_a[i]
        ans += 1

print(ans)
N,x = map(int,input().split())
a = list(map(int,input().split()))

a.sort()

count = 0
total = 0
for i in range(N):
    if total <=x:
        count += 1
        total += a[i]
    else:
        break
if total < x:
    count = N-1
print(count)
N,x=map(int,input().split())
a = list(map(int,input().split()))
cnt = 0
a.sort()
for i in a:
    if x >= i:
        x -= i
        cnt +=1
    else:
        print(cnt)
        exit()
print(cnt)
N,x = map(int,input().split())
A = sorted(list(map(int,input().split())))
i = 0
while i<N and x>=A[i]:
    x -= A[i]
    i += 1
if x>0:
    i -= 1
print(max(0,i))
from itertools import accumulate
import bisect
N,x = map(int,input().split())
A = sorted(list(map(int,input().split())))
A = list(accumulate(A))
ind = bisect.bisect_right(A,x)-1
if A[ind] == x:
    print(ind+1)
else:
    print(ind)
n,x = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
ans = 0
for i in range(n):
    if x >= a[i]:
        ans += 1
        x -= a[i]
    else:
        break
'''
if x > 0 and ans != 0:
    ans -= 1
'''
print(ans)
N, x = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)
c = 0
for i in range(N):
    if x >= a[i]:
        x -= a[i]
        c += 1
    else:
        break
if x > 0:
    print(N-1)
else:
    print(c)
N,x = map(int,input().split())
A = sorted(list(map(int,input().split())))
ans = 0
for i,a in enumerate(A):
    x = x-a
    if x<0:
        break
    elif i==len(A)-1:
        if x!=a:
            break
    ans+=1
print(ans)
N,x = map(int, input().split())
A = list(map(int, input().split()))

A.sort()

print(A)
ans = 0
for i in range(N):
  if x > A[i]:
    ans += 1
    x -= A[i]
  elif x == A[i]:
    print(ans+1)
    break
  else:
    print(ans -1)
    break
else:
  print(ans-1)
N,x=map(int,input().split())
A=sorted(list(map(int,input().split())),reverse=True)
cnt=0
for i in range(N-1):
    if x-A[i]>=0:
        cnt+=1
        x-=A[i]
    else:
        break
if x-A[N-1]==0:
    cnt+=1

print(cnt)
# https://atcoder.jp/contests/agc027/tasks/agc027_a
n, x = map(int, input().split())
nums = [int(i) for i in input().split()]
nums.sort()

if sum(nums) == x:
    print(n)
else:
    c = 0
    for i in range(n):
        if x >= nums[i]:
            c += 1
            x -= nums[i]
    if x > 0:
        print(max(0, c - 1))
    else:
        print(c)
n,x = map(int,input().split())
a = list(map(int,input().split()))
cnt = 0
if sum(a) < x:
    print(n-1)
elif sum(a) == x:
    print(n)
else:
    for i in a:
        if x >= i:
            cnt += 1
            x -= i
    print(cnt)
N,x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
for i in range(N):
    x -= a[i]
    if x <= 0:
        print(i+1)
        exit()
print(N)
N,x=input().split()
X=int(x)
n=int(N)
y=0
A = [int(i) for i in input().split()]
A.sort()
for z in range(n):
  if y>=X:
    break
    print(z+1)
  y+=A[z]
if y>=X:
  print(N)
else:
  print(N)
n,x = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
cnt = 0
for i in a:
    if x >= i:
       cnt += 1
       x -= i
if x > 0:
    cnt -= 1
if cnt < 0:
    cnt = 0
print(cnt)
try:
    N, x = map(int, input().split())
    l = list(map(int, input().split()))
    l_ = sorted(l)
    cnt = 0
    for i in l_:
        _ = x-i
        if _>= 0:
            cnt += 1
        if _<0:
            break
    print(cnt)
except EOFError:
    pass
import sys
N, x = map(int, input().split())
a = sorted(map(int, input().split()))
ans = 0
score_x  = x

if score_x < a[0]:
    print(0)
    sys.exit()
    
for  i in range(N):
    if i == (N-1):
        if a[i] == score_x:
            ans = ans + 1
        else:
            break      
    if score_x  >= a[i]:
        score_x = (score_x - a[i])
        ans = ans + 1


print(ans)
n, x = map(int, input().split())
a = list(map(int, input().split()))

a.sort()

cnt = 0
for i in a:
    if x >= i:
        x -= i
        cnt += 1
    else:
        break
if x != 0 and cnt != 0:
    cnt -= 1

print(cnt)
n, x = map(int, input().split())
a = list(map(int, input().split()))

a.sort()
count = 0

while x > min(a):
    for i in a:
        if x >= i:
            x -= i
            count += 1
        else:
            pass
        
print(count)
N, x = [int(x) for x in input().strip().split()]
an = sorted([int(a) for a in input().strip().split()])
cumsum = 0
for i, a in enumerate(an, start=1):
  cumsum += a
  if cumsum > x:
    break
print(i)
n,x=map(int,input().split())
A=sorted(list(map(int,input().split())))
for i in range(n):
    x-=A[i]
    if x<0:
        print(i)
        break
else:print(n)
n,x=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(n):
  if a[i]<=x:
    x=x-a[i]
    ans=ans+1
print(ans)
n, x = map(int, input().split())
a = sorted(map(int, input().split()))
ans = 0
for i in range(n):
    if x >= a[i]:
        x -= a[i]
        ans += 1
print(max(0, ans - (x > 0)))
N, x = map(int, input().split())
a = list(map(int, input().split()))

ans = 0
a.sort()
a_sum = [sum(a[:i+1]) for i in range(len(a))]

for i, item in enumerate(a_sum):
    if x < item:
        ans = i
        break
    elif x == item:
        ans = i+1
    elif x > item and i == len(a_sum):
        ans = i

print(ans)
N,x = list(map(int,input().split()))
A = list(sorted(list(map(int,input().split()))))
for i in range(N,0,-1):
    if sum(A[:i]) <= x:
        print(i)
        break
else:
  print(0)
n, x = map(int, input().split())
a = list(map(int, input().split()))

l = sorted(a)
flag = False
for i in range(n):
    x -= l[i]
    if x < 0:
        flag = True
        break
if flag:
    print(i)
else:
    print(n)
N, x = map(int, input().split())
child_list = list(map(int, input().split()))

count = 0
for child in sorted(child_list):
  x -= child
  if x < 0:
    break
  count += 1

count = N if count >= N else count
print(count)
if __name__ == "__main__":
    n, x = map(int, input().split())
    a = list(map(int, input().split()))

    a.sort()

    ans = 0
    tmp = 0
    for aa in a:
        if tmp < x and aa <= x-tmp:
            tmp += aa
            ans += 1
    if x-tmp > 0 and ans > 0:
        ans -= 1

    print(ans)
n, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
    if a[i] <= x:
        ans += 1
        x -= a[i]
    else:
        break

print(ans)
n, x = map(int, input().split())
a_l = list(map(int, input().split()))
a_l = sorted(a_l)
ans = 0
for a in a_l:
    x = x-a
    if x < 0:
        break
    ans += 1
print(ans)
N, x = map(int, input().split())
a = map(int, input().split())

a = sorted(a)

re = x
i = 0
ans = 0

for i in range(N):
    if a[i]<re:
        re -= a[i]
        ans += 1
    else:
        break

if ans==N and re>0:
    ans -= 1

print(ans)
n,x = map(int,input().split())
a_list = list(map(int,input().split()))
a_list.sort()
count = 0
for i in range(n):
    if a_list[i] <= x:
        count += 1
        x = x-a_list[i]
    else:
        break
print(count)
n, x = map(int, input().split())
l = sorted(list(map(int, input().split())))
if sum(l) <= x:
    print(n)
else:
    for i in range(n):
        if x <= 0:
            break
        x -= l[i]
    print(i)
n, x = map(int, input().split())

nums = sorted(list(map(int, input().split())))

count = 0
for num in nums:
    if (num <= x and num != nums[-1]) or (num == x and num == nums[-1]):
        count += 1
        x -= num        
    else:
        break

print(count)
from typing import SupportsComplex


N, x = [int(a) for a in input().split()]
a = [int(a) for a in input().split()]
a = sorted(a)

result = []
for v in a:
    if x >= v:
        result.append(v)
        x -= v
    else:
        break

if len(result) == 0:
    print(0)
    exit()

if x > 0:
    result[-1] += x

if result[-1] != a[len(result)-1]:
    ans = len(result)-1
else:
    ans = len(result)

print(ans)
from itertools import accumulate

N, x, *A = map(int, open(0).read().split())
A.sort()
B = list(accumulate(A)) # cumsum

ans = 0
for i in range(len(B)):
    ans = i
    if x == B[i]:
        ans += 1
        break
    elif x < B[i]:
        ans -= 1
        break

if ans < 0:
    ans = 0
print(ans)
n,x=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
ans=0
num=0
for i in a:
  ans+=1
  num+=i
  if num>x:
    print(ans-1)
    exit()
print(n)
N, x = map(int, input().split())

a = list(map(int, input().split()))

a.sort()

current = x
result = 0

for i in range(N):
    if  current >= a[i]:
        current -= a[i]
        result += 1

if current > 0 and result != 0:
    result -= 1

print(result)
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
s=0
while s<n:
  if m>=a[s]:
    m-=a[s]
    s+=1
  else:break
if m>0:#最後余った時
  s-=1
print(s)
n,x = map(int,input().split())
a = list(map(int,input().split()))
ans = 0

if sum(a) ==x:
    print(n)
else:
    a.sort()
    for i in range(n):
        if x >= a[i]:
            ans += 1
            x -= a[i]
        else:
            break

    if x != 0 and ans != 0:
        ans -= 1


    print(ans)
#ABC105-B
n = int(input())
divisor_list = []
ans = 0
for i in range(1,n+1):
    divisor_list = []
    #odd,even判定
    if(i % 2 != 0):
        #約数をdivisor_listに追加していく
        for j in range(1,i+1):
            if (i % j == 0):
                divisor_list.append(j)
            if(len(divisor_list) == 8):
                ans += 1
print(ans)
n=int(input())
if 104>=n:
  print(0)
elif 105<=n<=134:
  print(1)
elif 135<=n<=164:
  print(2)
elif 165<=n<=188:
  print(3)
elif 189<=n<=194:
  print(4)
else:
  print(5)
#coding:utf-8
n = int(input())
ans = 0

#n以下のすべての奇数について全探索
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)
a=int(input())
if a<=104:
    ans=0
elif a<135:
    ans=1
elif a<165:
    ans=2
elif a<189:
    ans=3
elif a<195:
    ans=4
else:
    ans=5
print(ans)
import numpy as np

n = int(input())
l = [0 for i in range(0, 201)]

for i in range(1, 201):
    for j in range(i, 201):
        if j/i == int(j/ i):
            l[j] += 1

l = np.array(l[1:n+1:2])>=8
print(sum(l))
def make_divisors(n):
    a,b =[],[]
    i = 1
    while i*i<=n:
        if n%i == 0:
            a.append(i)
            if i != n//i:
                b.append(n//i)
        i+= 1
    return a+b[::-1]

n = int(input())
c = 0
for i in range(1,n+1):
    if len(make_divisors(i))== 8 and i%2==1:
        c+=1
print(c)
N = int(input())
cnt = 0
for i in range(1,N+1,2):
    ans=0
    for j in range(1,i+1):
        if i % j == 0:
            ans += 1
        else:
            pass
    if ans == 8:
        cnt += 1
    else:
        pass
print(cnt)
def main():
    N = int(input())
    num = 0
    for i in range(1, N + 1):
        if i % 2 == 1:
            count = 0
            for j in range(1, N + 1):
                if i % j == 0:
                    count += 1
            if count == 8:
                num += 1
    print(num)
main()
N = int(input())
count = 0
for i in range(1,N+1):
    yaku = 0
    if i%2 == 1:
        for j in range(1,i+1):
            if i%j == 0:
                yaku += 1
        if yaku == 8:
            count += 1
print(count)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

n = int(input())
ans = 0
for i in range(1,n+1):
  if i % 2 == 1 and len(make_divisors(i)) == 8:
    ans += 1
print(ans)
n = int(input())
c = 0
a = [105,165,195]
if (n<105):
    print(0)
elif (105<=n and n<135):
    print(1)
elif (n >= 195):
    print(5)
elif (135<=n and n<165):    
    print(2)
elif (165<=n and n<189):
    print(3)
else:
    print(4)
N = int(input())
def divisor_all(n): # 約数全列挙
    l = [1,n]
    for i in range(2,int(pow(n,1/2))+1):
        if n % i == 0:
            if i == n//i:
                l.append(i)
            else:
                l.append(i)
                l.append(n//i)
    l.sort()
    return l # list
ans = 0
for i in range(1,N+1,2):
    if len(divisor_all(i))==8:
        ans += 1
print(ans)
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)
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)
import itertools
N=int(input())
prime=[3,5,7,11,13,17,19]

comb = list(itertools.combinations(prime,3))

lst=[]
for i in range(len(comb)):
    temp=comb[i][0]*comb[i][1]*comb[i][2]
    if temp<=200:
        lst.append(temp)

lst.append(135)
lst.append(189)

ans = sum(N>=x for x in lst)
print(ans)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

In = int(input())
count = 0
for i in range(1,In+1,2):
    if len(make_divisors(i))==8:
        count+=1

print(count)
n = int(input())

ans = 0
for i in range(1, n+1):
  cnt = 0
  for j in range(1, i+1):
    if i % j == 0: cnt += 1
  ans += i&1 and cnt == 8
print(ans)
n = int(input())
a = 0
for i in range(1, n+1, 2):
    c = 0
    for j in range(1, n+1):
        if i%j==0:
            c += 1
    if c == 8:
        a += 1
print(a)
n = int(input())
ans = 0
for i in range(1,n+1,2):
    a = 0
    for j in range(1,i+1): 
            if i % j == 0:
                a += 1
    if a == 8:
        ans += 1
        
print(ans)
n = int(input())

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

print(len(total))
n = int(input())
res = 0

for i in range(1,n+1):
    cnt = 0
    for j in range(1,i+1):
        if i % 2 == 1 and i % j == 0:
            cnt += 1
    if cnt == 8: res += 1
print(res)
n = int(input())
odd_list = [num for num in range(1, n+1, 2)]
cnt_8 = 0
for i in odd_list:
    cnt = 0
    for j in range(1, i+1, 2):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        cnt_8 += 1
print(cnt_8)
N = int(input())
ans = 0
for n in range(1,N+1,2):
    sm = sum(n % i == 0 for i in range(1,n+1))
    if sm == 8:
        ans += 1
print(ans)
N = int(input())
res = 0
for n in range(1, N+1, 2):
    cnt = 0
    for i in range(1, n+1):
        if n % i == 0:
            cnt += 1
    if cnt == 8:
        res += 1
print(res)
N=int(input())
ans=0
for i in range(1,N+1):
    tmp=0
    if i%2!=0:
        for j in range(1,i+1):
            if i%j==0:
                tmp+=1
        if tmp==8:
            ans+=1
print(ans)
N=int(input())
count=0
for i in range(105,N+1,2):
    divisor=0
    for j in range(1,i+1):
        if(i%j==0):divisor+=1
    if(divisor==8):count+=1
print(count)
n=int(input())
count=0
ans=0
for j in range(1,n+1,2):
  count=0
  for i in range(1,int(j**0.5)+1):
    if j%i==0:
      if j//i!=i:
        count+=2
      else:
        count+=1
  if count==8:
    ans+=1
print(ans)
MAX_N = 200
N = int(input())
a = [3, 5]
i = 7
while 3 * 5 * i < MAX_N:
  a.append(i)
  i += 2
len_a = len(a)
dot = []
for j in range(len_a-2):
  for k in range(j+1, len_a-1):
    for l in range(k+1, len_a):
      d = a[j] * a[k] * a[l]
      if d < MAX_N:
        dot.append(a[j] * a[k] * a[l])
dot = sorted(dot)
r = 0
for x in dot:
  if x <= N:
    r += 1
  else:
    break
print(r)
N = int(input())
l = []
for i in range(1, N + 1, 2):
  count = 0
  for j in range(1, i + 1, 2):
    if i % j == 0:
      count += 1
  if count == 8:
    l.append(i)
print(len(l))
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)
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)
input = int(input())
count = 0
for i in range(1, input + 1, 2):
    num = 0
    for j in range(2, i):
        if i % j == 0:
            num += 1
    if num == 6:
        count += 1
print(count)
N = int(input())

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

print(ans)
N = int(input())
count = 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:
        count+=1
print(count)
N = int(input())
ans = 0
for n in range(1, N+1):
    if n%2 == 1:
        count = 0
        for i in range(1, n+1):
            if n%i == 0:
                count += 1
        if count == 8:
            ans += 1

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

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

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

    divisors.sort()
    return divisors

def solve():
    n = int(input())
    ans = 0
    for i in range(1, n+1):
        if len(make_divisors(i)) == 8 and i%2 == 1:
            ans += 1
    
    print(ans)

if __name__ == "__main__":
    solve()
n = int(input())
counter = 0
for i in range(1, n+1, 2):
    divisor_counter = 0
    for j in range(1, i+1):
        if i % j == 0:
            divisor_counter += 1

    if divisor_counter == 8:
        counter += 1
print(counter)
N = int(input())

totalcount = 0

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

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

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

ans = 0
for i in range(1, N+1, 2):
    if len(make_divisors(i)) == 8:
        ans += 1
print(ans)
alist=[105,135,165,189,195]
ans=0
n=int(input())
for i in alist:
  if n>=i:
    ans+=1
print(ans)
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)
N = int(input())
ans = 0
for i in range(1, N + 1, 2):
    count = 0
    n = 1
    while n * n <= i:
        if not i % n:
            if n * n == i:
                count += 1
            else:
                count += 2
        n += 2
    if count == 8:
        ans += 1
print(ans)
n = int(input())
count = 0
ans = 0
j = 1

for i in range(1, n+1, 2):
    while j <= i:
        if i % j == 0:
            count += 1
        j += 1
    if count == 8:
        ans += 1
    count = 0
    j = 1
            
print(ans)
n=int(input())
#n,m=map(int,input().split())
#hl=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

def divnum(n):
    res=0
    for i in range(1,n+1):
        if n%i==0:
            res+=1
    if res==8:
        return True
    else:
        return False
count=0
for i in range(1,n+1):
    if i%2!=0 and divnum(i):
        count+=1
print(count)
n=int(input())
ans=0
for i in range(1,n+1):
    cnt=0
    if i%2 == 1:
        for j in range(1,i+1):
            if i%j == 0:
                cnt += 1
    if cnt == 8:
        ans += 1
print(ans)