CodeEff/ECCO huggingface dataset:
# Original solution
n=int(eval(input()))
l = [list(map(int,input().split())) for i in range(n)]
ans='No'
    
for i in range(n-2):

    if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] and l[i+2][0]==l[i+2][1]:
        ans='Yes'
        break
    
print(ans)

# Optimized solution
n=int(eval(input()))
l = [list(map(int,input().split())) for i in range(n)]
ans='No'
    
for i in range(n-2):

    if l[i][0]==l[i][1] and l[i+1][0]==l[i+1][1] and l[i+2][0]==l[i+2][1]:
        ans='Yes'
    
print(ans)
# Original solution
# (10-x) ways: (0,x)-(9-x,9) -> (x, -x)           <- This should never happens when D > 0
# (x) ways:    (10-x,0)-(9,x-1) -> (x-10, 10 - x)

def solve(d, k, outer):
  if k <= 1:
    return 10**k if d == 0 else 0
  # if d >= 10**k:
  #   return 0

  t = (-d)%10 # 10-d%10 doesn't work when d = 10
  d -= t*10**(k-1) - t
  return (10-t-outer)*solve(abs(d//10), k-2, 0)

D = int(eval(input()))
result = 0
for k in range(1,20):
  result += solve(D, k, 1)

print(result)

# Optimized solution
def solve(d, K):
  r = 1
  for k in range(K,1,-2):
    if d >= 10**k:
      return 0
    t = (-d)%10
    d = abs((d-t*(10**(k-1)-1))//10)
    r *= 10-t-(K==k)
  return r*(10**(K%2)) if d == 0 else 0

D = int(eval(input()))
result = 0
l = len(str(D))
for k in range(l,2*l+1):
  result += solve(D, k)

print(result)
# Original solution
import itertools as ite
import math
import random

INF = 10 ** 18
MOD = 10 ** 9 + 7

def func(diff, cnt9, cnt0):
    if cnt9 <= 0:
        return (diff == 0)
    num = int("9" * cnt9 + "0" * cnt0)
    return sum(func(diff + i * num, cnt9 - 2, cnt0 + 1) * (9 - abs(i) + 1 - (cnt0 < 1)) for i in range(-9, 10) if abs(diff + i * num) < num)

D = eval(input())

ans = 0
for d in range(1, 21):
    MUL = 1 if d % 2 == 1 else 10
    ans += func(D, d, 0) * MUL
print(ans)


# Optimized solution
import itertools as ite
import math
import random

INF = 10 ** 18
MOD = 10 ** 9 + 7

def func(diff, cnt9, cnt0):
    if cnt9 <= 0:
        return (diff == 0)
    num = int("9" * cnt9 + "0" * cnt0)
    return sum(func(diff + i * num, cnt9 - 2, cnt0 + 1) * (9 - abs(i) + 1 - (cnt0 < 1)) for i in range(-9, 10) if abs(diff + i * num) < num)

D = eval(input())

ans = 0
for d in range(1, 21):
    ans += func(D, d, 0) * (10 - d % 2 * 9)
print(ans)
# Original solution
import itertools as ite
import math
import random

INF = 10 ** 18
MOD = 10 ** 9 + 7

def func(diff, cnt9, cnt0):
    if cnt9 <= 0:
        return (diff == 0)
    num = int("9" * cnt9 + "0" * cnt0)
    return sum(func(diff + i * num, cnt9 - 2, cnt0 + 1) * (9 - abs(i) + 1 - (cnt0 < 1)) for i in range(-9, 10) if abs(diff + i * num) < num)

D = eval(input())

ans = 0
for d in range(1, 21):
    ans += func(D, d, 0) * (10 - d % 2 * 9)
print(ans)


# Optimized solution
def func(diff, cnt9, cnt0):
    if cnt9 <= 0 : return diff == 0
    num = int("9" * cnt9 + "0" * cnt0)
    return sum(func(diff + i * num, cnt9 - 2, cnt0 + 1) * (9 - abs(i) + 1 - (cnt0 < 1)) for i in range(-9, 10) if abs(diff + i * num) < num)

D = eval(input())
print(sum(func(D, d, 0) * (10 - d % 2 * 9) for d in range(1, 21)))
# Original solution
for i in range(int(eval(input()))):
	c,a,n = list(map(int,input().split()))
	cnt = 0
	while True:
		if c<1 or a<1 or n<1:
			break
		c -= 1
		a -= 1
		n -= 1
		cnt += 1
	while True:
		if c<2 or a<1:
			break
		c -= 2
		a -= 1
		cnt += 1
	while True:
		if c<3:
			break
		c -= 3
		cnt += 1
	print(cnt)

# Optimized solution
for i in range(int(eval(input()))):
	c,a,n = list(map(int,input().split()))
	cnt1 = min(c,a,n)
	c -= cnt1
	a -= cnt1
	cnt2 = min(c//2,a)
	c -= cnt2*2
	cnt3 = c//3
	print((cnt1+cnt2+cnt3))
# Original solution
h, w = list(map(int, input().split()))

mp = []
for _ in range(h):
  lst = list(map(int, input().split()))
  cum = []
  acc = 0
  for i in lst:
    if not i:
      acc += 1
    else:
      acc = 0
    cum.append(acc)
  mp.append(cum)
mp.append([-1] * w)
ans = 0

#print(*mp, sep="\n")
for i in range(w - 1, -1, -1):
  stack = []
#  print(ans)
  for j in range(h + 1):
#    print(stack)
    score = mp[j][i]
    if not stack:
      stack.append((score, j))
    else:
      last_score, last_ind = stack[-1][0], stack[-1][1]
      if score > last_score:
        stack.append((score, j))
      elif score == last_score:
        continue
      else:
        while stack and stack[-1][0] > score:
          last_score, last_ind = stack.pop()
          ans = max(ans, last_score * (j - last_ind))
        if not stack:
          stack.append((score, last_ind))
        elif stack[-1][0] == score:
          pass
        else:
          stack.append((score, last_ind))

print(ans)


# Optimized solution
h, w = list(map(int, input().split()))

mp = []
for _ in range(h):
  lst = list(map(int, input().split()))
  cum = []
  acc = 0
  for i in lst:
    if not i:
      acc += 1
    else:
      acc = 0
    cum.append(acc)
  mp.append(cum)
mp.append([-1] * w)
ans = 0

for i in range(w):
  stack = []

  for j in range(h + 1):
    score = mp[j][i]

    if not stack:
      stack.append((score, j))

    else:
      last_score, last_ind = stack[-1][0], stack[-1][1]
      if score > last_score:
        stack.append((score, j))
      
      elif score == last_score:
        continue
      
      else:
        while stack != [] and stack[-1][0] >= score:
          last_score, last_ind = stack.pop()
          ans = max(ans, last_score * (j - last_ind))
        stack.append((score, last_ind))

print(ans)
# Original solution
from sys import stdin
from collections import deque
readline = stdin.readline
h, w = list(map(int, readline().split()))
w += 1
dp = [list(map(int, readline().split())) + [1] for _ in range(h)]
for i in range(h):
    for j in range(w):
        dp[i][j] ^= 1
for i in range(1, h):
    for j in range(w):
        if dp[i][j]:
            dp[i][j] += dp[i - 1][j]
max_s = 0
for i in range(h):
    stack = deque()
    for j in range(w):
        if (stack[-1][0] if stack else 0) < dp[i][j]:
            stack.append((dp[i][j], j))
        elif stack and stack[-1][0] > dp[i][j]:
            while stack and stack[-1][0] > dp[i][j]:
                height, l = stack.pop()
                s = height * (j - l)
                if max_s < s:
                    max_s = s
            if dp[i][j]:
                stack.append((dp[i][j], l))
print(max_s)

# Optimized solution
from sys import stdin
from collections import deque
def judge(n,hs):
    stack = deque()
    ans = 0
    for i, h in enumerate(hs):
        j = -1
        while stack and stack[-1][1] > h:
            j, h2 = stack.pop()
            ans = max(ans, (i - j) * h2)
        if not stack or stack[-1][1] < h:
            stack.append((i if j == -1 else j, h))
    ans = max(ans, max((n - j) * h2 for j, h2 in stack))
    return ans
H,W = list(map(int,stdin.readline().split()))
hs = [0]*W
result = 0
for i in range(H):
    ht = list(map(int, stdin.readline().split()))
    hs = list(map(lambda x,y:(x+1)*abs(y-1),hs,ht))
    result = max(result,judge(W,hs))
print(result)
# Original solution
def max_rectangle(array):
    max_area = 0

    for i in range(1, max(array) + 1):
        current_area = 0
        for j in range(len(array)):
            if array[j] >= i:
                current_area += i
                if current_area > max_area:
                    max_area = current_area
            else:
                current_area = 0

    return max_area


def algorithm():
    r, c = list(map(int, input().split(' ')))

    ans_array = [0 for _ in range(c)]
    input_matrix = []

    for _ in range(r):
        input_matrix.append(list(map(int, input().split(' '))))

    largest_square = 0

    for i in range(r):
        for j in range(c):
            ans_array[j] = ans_array[j] + 1 if input_matrix[i][j] == 0 else 0
        m = max_rectangle(ans_array)
        largest_square = largest_square if largest_square > m else m

    print(largest_square)


def main():
    algorithm()


if __name__ == '__main__':
    main()

# Optimized solution
def new_max_rectangle(array):
    max_area = 0

    for i in range(len(array)):
        min_height = array[i]
        width = 1
        for j in range(i, len(array)):
            if array[j] == 0:
                width = 1
                if j < i:
                    min_height = array[j + 1]
                continue
            min_height = array[j] if min_height > array[j] else min_height
            max_area = width * min_height if width * min_height > max_area else max_area
            width += 1

    return max_area


def algorithm():
    r, c = list(map(int, input().split(' ')))

    ans_array = [0 for _ in range(c)]
    input_matrix = []

    for _ in range(r):
        input_matrix.append(list(map(int, input().split(' '))))

    largest_square = 0

    for i in range(r):
        for j in range(c):
            ans_array[j] = ans_array[j] + 1 if input_matrix[i][j] == 0 else 0
        m = new_max_rectangle(ans_array)
        largest_square = largest_square if largest_square > m else m

    print(largest_square)


def main():
    algorithm()


if __name__ == '__main__':
    main()
# Original solution
mod = 10 ** 9 + 7

n,m = list(map(int,input().split()))

x = list(map(int,input().split()))
y = list(map(int,input().split()))

sum = 0
for i in range(n-1):
  for j in range(m-1):
    h = x[i+1] - x[i]
    v = y[j+1] - y[j]
    sum = (sum + h*v*(i+1)*(n-i-1)*(j+1)*(m-j-1)) % mod


print((sum % mod))

# Optimized solution
mod = 10 ** 9 + 7

n,m = list(map(int,input().split()))

x = list(map(int,input().split()))
y = list(map(int,input().split()))

sum_h = 0
sum_v = 0
for i in range(n-1):
  sum_h += (x[i+1] - x[i])*(i+1)*(n-i-1)
sum_h = sum_h % mod

for j in range(m-1):
  sum_v += (y[j+1] - y[j])*(j+1)*(m-j-1)
sum_v = sum_v % mod

sum = (sum_h * sum_v) % mod

#print(sum_h,sum_v)
print(sum)
# Original solution
from operator import mul

n, m = list(map(int, input().split()))
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

dXs = [0] * (n - 1)
for i in range(n - 1):
    dXs[i] = xs[i + 1] - xs[i]

dYs = [0] * (m - 1)
for j in range(m - 1):
    dYs[j] = ys[j + 1] - ys[j]

fXs = [(i + 1) * (n - i - 1) for i in range(n)]
fYs = [(j + 1) * (m - j - 1) for j in range(m)]

MOD = 10 ** 9 + 7
ans = 0
for dY, fY in zip(dYs, fYs):
    ans += dY * fY * sum(map(mul, dXs, fXs))
    ans %= MOD

print(ans)


# Optimized solution
from operator import mul

n, m = list(map(int, input().split()))
xs = list(map(int, input().split()))
ys = list(map(int, input().split()))

MOD = 10 ** 9 + 7

fX = sum(map(mul, xs, list(range(-n + 1, n + 1, 2)))) % MOD
fY = sum(map(mul, ys, list(range(-m + 1, m + 1, 2)))) % MOD

print(((fX * fY) % MOD))
# Original solution
ai = lambda: list(map(int, input().split()))

n,m = ai()
x = ai()
y = ai()
mod = 10**9+7
ans = 0

sx,ssx,sy,ssy = [x[0]], [x[-1]], [y[0]], [y[-1]]
for i in range(1, n):
    sx.append(sx[-1] + x[i])
    ssx.append(ssx[-1] + x[-i-1])
for i in range(1, m):
    sy.append(sy[-1] + y[i])
    ssy.append(ssy[-1] + y[-i-1])

a = sum(ssx[i] - sx[i] for i in range(n)) % mod
b = sum(ssy[i] - sy[i] for i in range(m)) % mod

ans = a*b % mod
print(ans)

# Optimized solution
ai = lambda: list(map(int, input().split()))

n,m = ai()
x = ai()
y = ai()
mod = 10**9+7

from itertools import accumulate as acc
sx = list(acc(x))
ssx = list(acc(x[::-1]))
sy = list(acc(y))
ssy = list(acc(y[::-1]))
    

a = sum(ssx[i] - sx[i] for i in range(n)) % mod
b = sum(ssy[i] - sy[i] for i in range(m)) % mod

print((a*b % mod))
# Original solution
mod=10**9+7
n,m=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
xl=0
yl=0
for i in range(n-1):
  r=i+1
  while r<n:
    xl=(xl+x[r]-x[i])%mod
    r+=1
for i in range(m-1):
  u=i+1
  while u<m:
    yl=(yl+y[u]-y[i])%mod
    u+=1
print((xl*yl%mod))

# Optimized solution
mod=10**9+7
n,m=list(map(int,input().split()))
x=list(map(int,input().split()))
y=list(map(int,input().split()))
xl=0
xt=0
yl=0
yt=0
for i in range(n-1):
  if i==0:
    for j in range(1,n):
      xt+=x[j]-x[i]
    xl=xt
  else:
    xt-=(x[i]-x[i-1])*(n-i)
    xl=(xl+xt)%mod
for i in range(m-1):
  if i==0:
    for j in range(1,m):
      yt+=y[j]-y[i]
    yl=yt
  else:
    yt-=(y[i]-y[i-1])*(m-i)
    yl=(yl+yt)%mod
print((xl*yl%mod))
# Original solution
MOD = 1000000007

def solve2(Xs, Ys):
    cell_num = (len(Xs) - 1) * (len(Ys) - 1)
    if len(Xs) < 2 or len(Ys) < 2:
        return 0

    area = (Xs[-1] - Xs[0]) * (Ys[-1] - Ys[0])
    ans = area * cell_num
    ans %= MOD
    return ans

def solve(Xs, Ys):
    if len(Xs) <= 3 and len(Ys) <= 3:
        return solve2(Xs, Ys)

    ans = solve2(Xs, Ys)
    for i in range(1, len(Xs) // 2):
        ans += solve2(Xs[i:-i], Ys)
        ans %= MOD
    for i in range(1, len(Ys) // 2):
        ans += solve2(Xs, Ys[i:-i])
        ans %= MOD
    ans += solve(Xs[1:-1], Ys[1:-1])
    ans %= MOD
    return ans

N, M = list(map(int, input().split()))
Xs = list(map(int, input().split()))
Ys = list(map(int, input().split()))
print((solve(Xs, Ys)))


# Optimized solution
#!/usr/bin/env python3
#
# まず1次元で考える
#   |  |   |  |
#   a  b   c  d
# とあるとき、長さの合計は
#  (b-a) + (c-a) + (d-a) + (c-b) + (d-b) + (d-c)
# = 3d + c - b - 3a
# これは、各点の座標を、<自分より左にある点の数> - <自分より右にある点の数> でかけたものの和である
#
# もとめる面積は X座標、Y座標それぞれについて蒸気を計算した積

MOD = 1000000007

def len_sum(Xs):
    size = len(Xs)
    ret = 0
    n = len(Xs) - 1
    # 負の値にMODをとることを防ぐため、座標の大きい点から計算する
    for x in reversed(Xs):
        ret += n * x
        ret %= MOD
        n -= 2
    return ret

def solve(Xs, Ys):
    x_len_sum = len_sum(Xs)
    y_len_sum = len_sum(Ys)
    return (x_len_sum * y_len_sum) % MOD

N, M = list(map(int, input().split()))
Xs = list(map(int, input().split()))
Ys = list(map(int, input().split()))
print((solve(Xs, Ys)))
# Original solution
import itertools


def main():
    n, m = list(map(int, input().split()))

    X = list(map(int, input().split()))
    Y = list(map(int, input().split()))

    s = 0
    for x in itertools.combinations(X, 2):
        for y in itertools.combinations(Y, 2):
            x_len = x[0] - x[1]
            y_len = y[0] - y[1]
            s += x_len * y_len

    print((s % (10 ** 9 + 7)))


if __name__ == '__main__':
    main()


# Optimized solution
import itertools


def main():
    n, m = list(map(int, input().split()))

    x = list(map(int, input().split()))
    y = list(map(int, input().split()))

    x_len = 0
    y_len = 0

    for i in range(n):
        x_len += (2 * i - n + 1) * x[i] % (10 ** 9 + 7)
        # print(x_len)

    for j in range(m):
        y_len += (2 * j - m + 1) * y[j] % (10 ** 9 + 7)
        # print(y_len)

    print((x_len * y_len % (10 ** 9 + 7)))


if __name__ == '__main__':
    main()
# Original solution
a, b = list(map(int, input().split()))
print(((a-1) * (b-1)))

# Optimized solution
n, m = list(map(int, input().split()))
print(((n-1)*(m-1)))
# Original solution
a,b=list(map(int,input().split()))
x = a-1
y = b-1
print((x*y))

# Optimized solution
a,b=list(map(int,input().split()))
print(((a-1)*(b-1)))
# Original solution
a=list(map(int,input().split()))
print(((a[0]-1)*(a[1]-1)))

# Optimized solution
a,b=list(map(int,input().split()))
print((a*b-a-b+1))
# Original solution
a, b = list(map(int, input().split()))
print(((a-1)*(b-1)))

# Optimized solution
def main():
    n,m = list(map(int,input().split()))
    print(((n-1)*(m-1)))

if __name__ == '__main__':
    main()
# Original solution
a,b = list(map(int,input().split()))
print(((a-1)*(b-1))) 


# Optimized solution
#!/usr/bin/env python3
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
a,b = list(map(int,input().split()))
print(((a-1)*(b-1)))
# Original solution
n,m=list(map(int, input().split()))

print((int((n-1)*(m-1))))

# Optimized solution
n,m=list(map(int, input().split()))

print(((n-1)*(m-1)))
# Original solution
n,m=list(map(int,input().split()))
print(((n-1)*(m-1)))

# Optimized solution
a,b=list(map(int,input().split()))
print((~-a*~-b))
# Original solution
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,m = inpl()
print(((n-1)*(m-1)))


# Optimized solution
a,b = list(map(int,input().split()))
print(((a-1)*(b-1)))
# Original solution
N, M = list(map(int, input().split()))
ans=(N-1)*(M-1)

print(ans)

# Optimized solution
N, M = list(map(int, input().split()))
print(((N-1)*(M-1)))
# Original solution
a = input().split()
print(((int(a[0]) - 1) * (int(a[1]) - 1)))

# Optimized solution
a,b=list(map(int,input().split()))
print(((a-1)*(b-1)))
# Original solution
print((eval('('+input().replace(' ','-1)*(')+'-1)')))

# Optimized solution
s=1
for i in input().split():s*=~-int(i)
print(s)
# Original solution
m,n = list(map(int,input().split()))
print(((m-1)*(n-1)))

# Optimized solution
n,m=list(map(int,input().split()))
print(((n-1)*(m-1)))
# Original solution
n, m = list(map(int, input().split()))
print(((n - 1) * (m - 1)))

# Optimized solution
a, b = list(map(int, input().split()))
print(((a - 1) * (b - 1)))
# Original solution
import itertools

while True:
    N, K, S = list(map(int, input().split()))
    if N == K == S == 0:
        break
    ans = 0
    for l in itertools.combinations(list(range(1, N+1)), K):
        if sum(l) == S:
            ans += 1
    print(ans)

# Optimized solution
import itertools

while True:
    N, K, S = list(map(int, input().split()))
    if N == K == S == 0:
        break
    print((sum(1 for l in itertools.combinations(list(range(1, N+1)), K) if sum(l) == S)))
# Original solution
def dfs(i,k,s):
    if k == s == 0: return 1
    if i > n or s < i*k+k-1: return 0
    return dfs(i+1,k,s)+dfs(i+1,k-1,s-i)
 
while 1:
    n,k,s = list(map(int,input().split()))
    if n == 0: break
    print(dfs(1,k,s))

# Optimized solution
import itertools
while 1:
    n,k,s = list(map(int,input().split()))
    if n == 0: break
    print(sum(sum(ele) == s for ele in itertools.combinations(list(range(1,n+1)),k)))
# Original solution
primes = [2]
for i in range(3, 200):
  for prime in primes:
    if i % prime == 0:
      break
  else:
    primes.append(i)
    
n = int(eval(input()))

ans = 0
for i in range(1, n + 1, 2):
  count = 0
  for prime in primes:
    if i % prime == 0:
      i //= prime
      count += 1
  if i == 1 and count == 3:
    ans += 1
    
for i in [3, 5]:
  for prime in primes[1:25]:
    if (i ** 3) * prime <= n and i != prime:
      ans += 1
    
print(ans)

# Optimized solution
n = int(eval(input()))
answers = [105, 135, 165, 189, 195]
for i, a in enumerate(answers):
  if n < a:
    print(i)
    break
  
else:
  print((5))
# Original solution
from math import sqrt
N = int(eval(input()))
ans = 0
for i in range(7, N+1):
  if i%2==0:
    continue
  c = 0
  for j in range(1, int(sqrt(i))+1):
    if i%j==0:
      if i//j==j:
        c+=1
      else:
        c+=2
  if c==8:
    ans += 1
print(ans)

# Optimized solution
from math import sqrt
N = int(eval(input()))
ans = 0
for i in range(7, N+1):
  if i%2==0:
    continue
  c = 0
  for j in range(1, int(sqrt(i))+1):
    if i%j==0:
      c+=2
  if c==8:
    ans += 1
print(ans)
# Original solution
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(eval(input()))
    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() # sort必要なかったらコメントアウト
             return len(divisors)
    ans=0
    for i in range(1,n+1,2):
        if make_divisors(i)==8:
            ans+=1
    print(ans)

resolve()

# Optimized solution
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(eval(input()))
    if 1<=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))
resolve()
# Original solution


import collections


def solve():

    N = int(eval(input()))

    def GetDivider(num):
        cnt = 0
        for i in range(1, num+1):
            if num % i == 0:
                cnt += 1

        return cnt

    ans = 0

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

    print(ans)


if __name__ == "__main__":
    solve()


# Optimized solution
N = int(eval(input()))


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


ans = 0
for i in range(1, N+1):
    if GetDivider(i) == 8:
        if i % 2 != 0:
            ans += 1
print(ans)
# Original solution
n = int(eval(input()))

counter = 0  

for i in range(1, n+1):
  if i%2!=0 and len([j for j in range(1,i+1) if i%j==0])==8:
    counter += 1
    
print(counter)

# Optimized solution
n = int(eval(input()))
ans = 0

for i in range(1, n+1, 2):
  counter = 0
  for j in range(1, i+1):
    if i%j==0:
      counter += 1
    if counter > 8:
      break
  if counter == 8:
    ans += 1
    
print(ans)
# Original solution
n = int(eval(input()))
l=[]
count=0
for h in range(n):
    for i in range(h+1):
        if (h+1)%(i+1)==0 and (h+1)%2!=0:
            l.append(h+1)
            if len(l)==8:
                count+=1
    if len(l)!=8:
        l.clear()
print(count)  

# Optimized solution
n = int(eval(input()))
cnt=0
ans=0
for i in range(1,n+1,2):
    for j in range(1,i+1):
        if i%j==0:
            cnt+=1
    if cnt==8:
        ans+=1
        cnt=0
    else:
        cnt=0
print(ans)
# Original solution
# 02 AtCoder Beginner Contest 106 B - 105
import sys
import math

N = int(eval(input()))


def divisor(n):
    ans = 0
    for i in range(1, n + 1, 2):  # 偶数は回答に含めないため、約数が　2の倍数となる数字は存在しない
        if n % i == 0:
            ans += 1
            # if i != int(math.sqrt(n)):
            #     ans += 1

    return ans


ans = 0
for i in range(105, N + 1, 2):  # 偶数は回答に含めない
    if divisor(i) == 8:
        ans +=1

print(ans)


# Optimized solution
# 02 AtCoder Beginner Contest 106 B - 105
import sys
import math

N = int(eval(input()))


def divisor(n):
    ans = 0
    for i in range(1, int(math.sqrt(n + 1)), 2):  # 偶数は回答に含めないため、約数が　2の倍数となる数字は存在しない
        if n % i == 0:
            ans += 1
            if i != int(math.sqrt(n + 1)):
                ans += 1

    return ans


ans = 0
for i in range(105, N + 1, 2):  # 偶数は回答に含めない
    if divisor(i) == 8:
        ans +=1

print(ans)
# Original solution
n = int(eval(input()))
dp = [1]*(n + 1)
ans = 0
# エラストテネスの箒
for i in range(2, n + 1):
    div = 1
    while i * div <= n:
        dp[i * div] += 1
        div += 1
# dp[1]から１個飛ばしで表示
print((dp[1::2].count(8)))

# Optimized solution
n = int(eval(input()))
cnt = 0
lista = [0] * (n + 1)
# 奇数のみ
for i in range(1, n + 1, 2):
    # 3 * 1, 3 * 3, 3 * 5...
    for j in range(i, n + 1, 2 * i):
        lista[j] += 1
for i in range(n + 1):
    if lista[i] == 8:
        cnt += 1
print(cnt)
# Original solution
#ABC105-B
n = int(eval(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)

# Optimized solution
#ABC105-B
n = int(eval(input()))
divisor_list = []
divisor_length = 0
ans = 0
for i in range(1,n+1):
    divisor_list = []
    divisor_length = 0
    #odd,even判定
    if(i % 2 != 0):
        #約数をdivisor_listに追加していく
        for j in range(1,i+1):
            if (i % j == 0):
                divisor_length += 1
    if(divisor_length == 8):
        ans += 1
print(ans)