Harryxun/stf_run huggingface dataset:
n=int(input())
field=[[0 for i in range(20)]for j in range(15)]
for i in range(n):
    b,f,r,v=map(int,input().split())
    h=(b-1)*4+f-1
    w=r*2-1
    n=v
    field[h][w]+=n
for y in range(15):
    for x in range(20):
        if(y%4==3):field[y][x]='#'
        elif x%2==0 :field[y][x]=' '
        print(field[y][x],end='')
    print()



### FIXED CODE ###

n=int(input())
field=[[0 for i in range(20)]for j in range(15)]
for i in range(n):
    b,f,r,v=map(int,input().split())
    h=(b-1)*4+f-1
    w=r*2-1
    n=v
    field[h][w]+=n
for y in range(15):
    for x in range(20):
        if(y%4==3):field[y][x]='#'
        elif x%2==0 :field[y][x]=' '
        print(field[y][x],end='')
    print()
import math

n,k = map(int, input().split())

def main(i):
  blue = int(math.factorial(k-1) / (math.factorial(i-1) * math.factorial(k-i)))
  red = int(math.factorial(n-k+1) / (math.factorial(n-k+1-i) * math.factorial(i)))
  print((blue*red) % (10**9 + 7))

for i in range(1, min(k, n-k+2)):
  main(i)

### FIXED CODE ###

import math
 
n,k = map(int, input().split())
 
def main(i):
  blue = math.factorial(k-1) // (math.factorial(i-1) * math.factorial(k-i))
  red = math.factorial(n-k+1) // (math.factorial(n-k+1-i) * math.factorial(i))
  print((blue*red) % (10**9 + 7))
 
for i in range(1, k+1):
  if i > n-k+1:
    print('0')
  else:
   main(i)
h, w = list(map(int, input().split()))
m = 1000000007

grid = [input() for _ in range(h)]

dp = [[0 for _ in range(w)] for _ in range(h)]
dp[0][0] = 1

for y in range(h):
    for x in range(w):
        if grid[y][x] == ".":
            if y > 0:
                dp[y][x] += dp[y-1][x]
            if x > 0:
                dp[y][x] += dp[y][x-1]

            dp[y][x] %= m

print(dp[h-1][w-1])

### FIXED CODE ###

h, w = list(map(int, input().split()))
m = 1000000007

grid = [input() for _ in range(h)]

dp = [[0 for _ in range(w)] for _ in range(h)]
dp[0][0] = 1

for y in range(h):
    for x in range(w):
        if grid[y][x] == ".":
            if y > 0:
                dp[y][x] += dp[y-1][x]
            if x > 0:
                dp[y][x] += dp[y][x-1]

            dp[y][x] %= m

print(dp[h-1][w-1])
n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
T = []

for h in range(n):
  T.append(ct[i][1])
  
if min(T) > t:
  print("TLE")
  exit()
else:
  for j in range(n):
    if ct[j][1] <= t:
    c = ct[j][0]
    k = j
    break
 

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)

### FIXED CODE ###

n,t = map(int,input().split())
ct = [list(map(int,input().split())) for i in range(n)]
T = []

for h in range(n):
  T.append(ct[h][1])
  
if min(T) > t:
  print("TLE")
  exit()
else:
  for j in range(n):
    if ct[j][1] <= t:
      c = ct[j][0]
      k = j
      break
 

for i in range(k+1,n):
  if ct[i][1] <= t:
    c = min(c,ct[i][0])
    
print(c)
A,B=map(int,input().map)
print(A-B+1)


### FIXED CODE ###

A,B=map(int,input().split())
print(A-B+1)
n,k = (int(x) for x in input().split())
M = 10**9+7
s = 0

for i in range(n+2-k):
    ad = 1 + (n+1-k-i)*(k+i)
    s += ad
    if s >= M:
        s -= N
        
print(s)

### FIXED CODE ###

n,k = (int(x) for x in input().split())
M = 10**9+7
s = 0

for i in range(n+2-k):
    ad = 1 + (n+1-k-i)*(k+i)
    s += ad
#if s >= M:
#    s -= M
        
print(s%M)
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=10**9+7

r1,c1,r2,c2=map(int,input().split())

# MOD combination
def cmb(n, r, mod=10**9+7):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

N = 10**6*2+1
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def g(r,c):
    tmp=cmb(r+1+c+1,r+1)-1
    return tmp%mod

ans=0
ans+=g(r2,c2)
ans-=g(r2,c1-1)
ans-=g(r1-1,c2)
ans+=g(r1-1,c1-1)
ans%=mod
print(ans)

### FIXED CODE ###

import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=10**9+7

r1,c1,r2,c2=map(int,input().split())

# MOD combination
def cmb(n, r, mod=10**9+7):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

N = 10**6*2+10
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def g(r,c):
    tmp=0
    for i in range(1,r+2):
        tmp+=cmb(i+c,i)
        tmp%=mod
    return tmp

ans=0
ans+=g(r2,c2)
ans-=g(r2,c1-1)
ans-=g(r1-1,c2)
ans+=g(r1-1,c1-1)
ans%=mod
print(ans)
n, q = map(int, input().split())
s = input()
a = [list(map(int, input().split())) for i in range(q)]

cum=[0]*n
for i in range(1, n):
    cum[i] = cum[i - 1]
    if s[i-1:i+1] == 'AC':
        cum[i]+=1
    print(cum)

for i in range(q):
    print(cum[a[i][1]-1]-cum[a[i][0]-1])

### FIXED CODE ###

dic = {
    'A': 'T',
    'T': 'A',
    'C': 'G',
    'G': 'C'
}

n=input()
print(dic[n])
N = int(input())
A = list(map(int, input().split()))
c = 0
s = set()

for a in A:
  if a >= 3200:
    c += 1
  else:
    s.add(a//400
print(max(1, len(s)), len(s) + c)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
c = 0
s = set()

for a in A:
  if a >= 3200:
    c += 1
  else:
    s.add(a//400)
print(max(1, len(s)), len(s) + c)
N = int(input())
ans = ["0"] * 2N

S, T = input().split()
for i in range(N):
  ans[2*i] = S[i]
  ans[2*i+1] = T[i]

print("".join(ans))

### FIXED CODE ###

N = int(input())
ans = ["0"] * 2 * N
 
S, T = input().split()
for i in range(N):
  ans[2*i] = S[i]
  ans[2*i+1] = T[i] 
print("".join(ans))
S = int(input())
if S = 'ABC':
  print('ARC')
else:
  print('ABC')

### FIXED CODE ###

S = input()
if S == 'ABC':
  print('ARC')
else:
  print('ABC')
import sys
sys.setrecursionlimit(10**9)
N, K = map(int, input().split())
mod = 10**9 + 7
G = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)
def p(n, k):
    x = 1
    for i in range(k):
        x *= n - i
        x %= mod
    return x
def f(x, par):
    L = len(G[x])
    if x == par:
        if L <= K-1:
            ans = K*p(K-1,L) % mod
        else:
            return 0
    elif x != par:
        if L-1 <= K-2:
            ans = p(K-2,L-1)
        else:
            return 0
    for i in G[x]:
        if i != par:
            ans *= f(i, x)
            ans %= mod
    return ans
print(f(0, 0))


### FIXED CODE ###

n=int(input())
arr=list(map(int,input().split()))
arr2=[0]*n
for i in range(0,2*n,2):
  arr2[i//2]=arr[i%n]
ans=[0]*n
s=sum(arr)//2
cum=[0]*n
start=sum(arr2[:n//2])
cum[0]=start
l=n//2
for i in range(n):
  start=start+arr2[(i+l)%n]-arr2[i]
  cum[(i+1)%n]=start
for i in range(n):
  ans[(n-1+i*2)%n]=(s-cum[i])*2
print(*ans)
a,b=list(map(int,input().split()))

if a*b%2==0:
    printf(a*b/2)
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

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

if (a+b)%2==0:
    print((a+b)//2)
else:
    print("IMPOSSIBLE")
n, m = [int(x) for x in input().split()]
img_a = []
img_b = []

for i in range(n):
    img_a.append(input())

for i in range(m):
    img_b.append(input())

ans = "No"
for a in range(n - m + 1):
    dup_a = img_a.copy()
    dup_b = img_b.copy()
    while True:
        for b in range(m):
            if dup_b[b] in dup_a[b+a]:
                if b == 0:
                    index = dup_a[a].index(dup_b[0])
                current_index = dup_a[b+a].index(dup_b[b])
                
                if current_index > index:
                    for line in dup_a:
                        del line[:current_index]
                        break
                elif current_index < index:
                    for line in dup_a:
                        del line[:index]
                        break
        
            else:   # if not substring in string.
                break
        else: # if not loop broken.
            ans = "Yes"
            break

print(ans)

### FIXED CODE ###

n, m = [int(x) for x in input().split()]
img_a = []
img_b = []

for i in range(n):
    img_a.append(input())

for i in range(m):
    img_b.append(input())

ans = "No"
for a in range(n - m + 1):
    border = 0
    flag = True
    while flag:
        for b in range(m):
            if img_b[b] in img_a[b+a][border:]:
                if b == 0:
                    index = img_a[a].index(img_b[0], border)
                current_index = img_a[b+a].index(img_b[b], border)
                if current_index == index:
                    continue
                elif current_index > index:
                    border = current_index
                    break
                else:
                    border = index
                    break
            else:   # if not substring in string.
                flag = False
                break

        else: # if not loop broken.
            ans = "Yes"
            break
        

print(ans)
r, g, b, n = map(int, input().split())
counter = 0
for s in range(n+1):
    for t in range(n-i+1):
        u = n - r*s - g*t
        if u >= 0 and u % b == 0:
            counter += 1
print(counter)

### FIXED CODE ###

n,k = map(int,input().split())
print(n-k+1)
n = int(input())
a, b = 0
for i in range(1, 10):
    b = i
    a = n // i
    if n % i !=0: continue
    elif a <= 9 and b <= 9: 
        print('Yes')
        break
    else :
        print('No')
        break

### FIXED CODE ###

n = int(input())
a = 0
b = 0
for i in range(1, 10):
    b = i
    a = n // i
    if n % i !=0: continue
    elif a <= 9 and b <= 9:
        print('Yes')
        exit()
print('No')
# B
a, b = map(int, input().split())
s = input()
n = len(s)
nums = list(range(10))
point = 0
flag = 'Yes'

if n != a+b+1:
    flag = 'No'
    print(flag)
    exit()

while point<=n-1:
    if point == a:
        if s[point] != '-':
            flag = 'No'
    else:
        if int(s[point]) not in nums:
            flag = 'No'
    point += 1
print(flag)

### FIXED CODE ###

a, b = map(int, input().split())
s = input()

if (s[a]=='-' and s.count('-')==1):
    print('Yes')
else:
    print('No')
n=int(input())
cnt=0
for i in range(n):
    a=int(input())
    cnt+=(a%2)
if:
    if cnt==0:
        print("second")
    else:
        print("first")

### FIXED CODE ###

n=int(input())
cnt=0
for i in range(n):
    a=int(input())
    cnt+=(a%2)
if cnt==0:
    print("second")    
else:
    print("first")
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

S = sys.stdin.buffer.readline().decode().rstrip()
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


S = sys.stdin.buffer.readline().decode().rstrip()
ok =S[2] == S[3] and S[4] == S[5]
if ok:
    print('Yes')
else:
    print('No')
a=list(map(int,input().split()))
n=0
zahyo=0
i=0
hane=list(map(int,input().split()))
while zahyo<=a[1]:
    n=n+1
    if i<=a[0]:
        zahyo=zahyo+hane[i]
        i=i+1
    else:
        break
print(n)

### FIXED CODE ###

a=list(map(int,input().split()))
n=1
zahyo=0
hane=list(map(int,input().split()))
for i in range(a[0]):
    if zahyo+hane[i]>a[1]:
        break
    else:
        zahyo=zahyo+hane[i]
        n=n+1
print(n)
# -*- coding: utf-8 -*-
import numpy as np

def lcs_sol(x, y):
    n = len(x)
    m = len(y)
    dp = np.zeros((n + 1) * (m + 1)).reshape(n + 1, m + 1)

    for i in range(1, n + 1):
        for j in range(1, m + 1):
            if x[i - 1] == y[j - 1]:
                dp[i][j] = dp[i - 1][j - 1] + 1
            else:
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])

    return dp[n][m]


if __name__ == '__main__':
    import sys
    q = int(sys.stdin.readline().strip())
    for i in range(q):
        x = sys.stdin.readline().strip()
        y = sys.stdin.readline().strip()
        print(lcs_sol(x, y))



### FIXED CODE ###

def m():
 e=input
 a=''
 for _ in[0]*int(e()):
  X,z=e(),[]
  for y in e():
   s=i=0
   for k in z:
    t=X.find(y,s)+1
    if t<1:break
    if t<k:z[i]=t
    s=k;i+=1
   else:
    t=X.find(y,s)+1
    if t:z+=[t]
  a+=f'\n{len(z)}'
 print(a[1:])
if'__main__'==__name__:m()
n=int(input())
p = list(map(int, input().split()))
count=0
for i in range (n - 2):
	if p[i]>p[i + 1]>p[i + 2] or p[i + 2]>p[i + 1]>p[i]:
    	count=count+1
print(count)

n

### FIXED CODE ###


n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(n - 2):
	if p[i] < p[i + 1] < p[i + 2] or p[i + 2] < p[i + 1] < p[i]:
		ans += 1
print(ans)
N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for _ in range(M)]

A.sort()
BC.sort(reverse = True, key = lambda x:x[1])
ans = sum(A)
idx = 0

for i in range(M):
    if A[idx+BC[i][0]-1] < BC[i][1]:
        ans += BC[i][1] * BC[i][0] - sum(A[idx:idx+BC[i][0]])
    else:
        for j in range(BC[i][0]):
            if A[idx+j] >= BC[i][1]:
                break
        ans += BC[i][1] * j - sum(A[idx:idx+j])
        break
    idx += BC[i][0]
    
print(ans)

            

### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [list(map(int,input().split())) for _ in range(M)]

A.sort()
BC.sort(reverse = True, key = lambda x:x[1])
ans = sum(A)
idx = 0

for i in range(M):
    if idx + BC[i][0] >= N :
        BC[i][0] = N-idx
    if A[idx + BC[i][0]-1] < BC[i][1]:
        ans += BC[i][1] * BC[i][0] - sum(A[idx:idx+BC[i][0]])
    else:
        for j in range(BC[i][0]):
            if A[idx+j] >= BC[i][1]:
                break
        ans += BC[i][1] * j - sum(A[idx:idx + j])
        break
    idx += BC[i][0]
    if idx > N-1:break
print(ans)
import functools
n,k=int(input())
p=list(map(int,input().split()))
p.sort()
for i in range(k):
  cost+=p[i]
print(cost)

### FIXED CODE ###

import functools
n,k=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
cost=functools.reduce(lambda x,y:x+y,p[:k],0)
print(cost)
nN = int(input())
 
sListA = []
nListA = [ 0 for i in range(nN)]
 
for i in range(nN):
  sTmp = input()
  if sTmp in sListA:
    nTmp = sListA.index(sTmp)
    nListA[nTmp] += 1
  else:
    sListA.append(sTmp)
    nTmp = sListA.index(sTmp)
    nListA[nTmp] += 1
 
    
nN = int(input())
sListB = []
nListB = [ 0 for i in range(nN)]
 
for i in range(nN):
  sTmp = input()
  if sTmp in sListA:
    nTmp = sListA.index(sTmp)
    nListA[nTmp] -= 1
  else:
    sListA.append(sTmp)
    nTmp = sListA.index(sTmp)
    nListA[nTmp] -= 1
 
nMax = max(nListA)
# print(sListA)
print(nMax)


### FIXED CODE ###

N = int(input())
Flag = 0
TmpNum = 0
Count = 0
Data = [[0 for i in range(2)]  for j in range(N)]

for i in range(N):
    TmpS = input()
    Num = i
    if Num == 0:
        Data[i][0] = TmpS
        Data[i][1] = 1
        Count += 1
    else:
        Flag = 0
        for i2 in range(Num):
            if TmpS == Data[i2][0]:
                Flag = 1
                TmpNum = i2
                break
        
        if Flag == 1:
            Data[TmpNum][1] += 1
        else:
            Data[Count][0] = TmpS
            Data[Count][1] = 1
            Count += 1

M = int(input())
for i in range(M):
    TmpS = input()
    for i2 in range(Count):
        if TmpS == Data[i2][0]:
            Data[i2][1] -= 1
            break

Data = sorted(Data, key=lambda x: x[1],  reverse=True) 

Ans = Data[0][1]
if Ans < 0:
    Ans = 0

print(Ans)
n, m, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
time = 0
i = 0
j = 0
while i <= n and j <= m and time <= k:
    if i == n:
        if j == m:
            break
        time += b[j]
        j += 1
        continue
    if j == n:
        time += a[i]
        i += 1
        continue
    if a[i] < b[j]:
        time += a[i]
        i += 1
        continue
    else:
        time += b[j]
        j += 1
        continue
if time > k:
    print(i+j-1)
else:
    print(i+j)


### FIXED CODE ###

n, m, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
s = 0
maxbooks = 0
for i in range(n):
    if s + a[i] <= k:
        s += a[i]
        continue
    else:
        i -= 1
        break
for j in range(m):
    if s + b[j] <= k:
        s += b[j]
        continue
    else:
        j -= 1
        break
maxbooks = i + j + 2
nowbooks = i + j + 2
#i, j: 読めたもの
while i >= 0 and j < m:
    s -= a[i]
    i -= 1
    nowbooks -= 1
    while j + 1 < m:
        if s + b[j+1] <= k:
            s += b[j+1]
            j += 1
            nowbooks += 1
            if nowbooks > maxbooks:
                maxbooks = nowbooks
            
            continue
        else:
            break
last = 0
s = 0
for j in range(m):
    if s + b[j] <= k:
        s += b[j]
        continue
    else:
        j -= 1
        break
if j > maxbooks:
    maxbooks = j
print(maxbooks)
from math import gcd

a,b = map(int,input().split())
print(a*b//gcd(a,b))

### FIXED CODE ###

A,B = map(int,input().split())
c = [0 for _ in range(1+max(A,B))]

ans = 1
#AとBで割り切れるような自然数を求める
# 2 <= ans <= A*B
def prime(n):
	res = [0 for _ in range(n+1)]
	for i in range(2,int(n**0.5)+1):
		while n%i == 0:
			res[i] += 1
			n = n//i
	if n != 1:
		res[n] = 1
	return res
a = prime(A)
b = prime(B)
for i in range(1+max(A,B)):
	if len(a)<=i:
		c[i] = b[i]
	elif len(b)<=i:
		c[i] = a[i]
	else:
		c[i] = max(a[i],b[i])


for i in range(1,len(c)):
	ans *= i**c[i]

print(ans)
n,Y = map(int,input().split())
y2 = Y // 1000
for a in range(n+1):
    y = y2
    rest = y - a * 10
    if rest < 0:break
    for b in range(n+1-a):
        rest -b * 5 < 0: break
        if n - a - b == rest - b * 5:
            print(a,b,n-a-b);exit()
print(-1,-1,-1)


### FIXED CODE ###

n,Y = map(int,input().split())
y2 = Y // 1000
for a in range(n+1):
    y = y2
    rest = y - a * 10
    if rest < 0:break
    for b in range(n+1-a):
        if rest -b * 5 < 0: break
        if n - a - b == rest - b * 5:
            print(a,b,n-a-b);exit()
print(-1,-1,-1)
a=input()
print(a+a*a+a*a*a)

### FIXED CODE ###

a=input()
a=int(a)
print(a+a*a+a*a*a)
W, H, w, y, r = map(int, input().split())

if x -r < 0 or x + r > W:
    print "No"

### FIXED CODE ###

w, h, x, y, r = map(int, input().split())

if x + r <= w and y + r >= 0 and x - r >= 0 and y + r <= h:
    print("Yes")
else:
    print("No")
import collections
from scipy.special import comb

n = int(input())
a_list = list(map(int, input().split()))
a_col = collections.Counter(a_list)
c_dic = {}
sm = sum([c * (c - 1) for c in a_col.values()]) // 2

for a in a_list:
    if a in c_dic:
        print(c_dic[a])
    else:
        ans = sm - comb(a_col[a], 2) + comb(a_col[a] - 1, 2)
        print(ans)
        c_dic[a] = ans

### FIXED CODE ###

import collections
import math

def combinations_count(n, r):
    if n < 2:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())
a_list = list(map(int, input().split()))
a_col = collections.Counter(a_list)
c_dic = {}
sm = sum([c * (c - 1) for c in a_col.values()]) // 2
for a in a_list:
    if a in c_dic:
        print(c_dic[a])
    else:
        ans = sm - combinations_count(a_col[a], 2) + combinations_count(a_col[a] - 1, 2)
        print(ans)
        c_dic[a] = ans
import collections
n = int(raw_input())

adj = collections.defaultdict(list)

for _ in range(n - 1):
	u, v, w = raw_input().split(' ')
	w = int(w)
	adj[u].append((v,w))
	adj[v].append((u,w))
q = collections.deque([(1,0)])
h = {1:0}
while(q):
	u,c = q.popleft()
	for v,w in adj[u]:
		if v not in h:
			h[v] =  1- c
			q.append((v,1-c))

for node in range(1, n+1): print h[node]

### FIXED CODE ###

import collections
n = int(raw_input())

adj = collections.defaultdict(list)

for _ in range(n - 1):
	u, v, w = map(int, raw_input().split(' '))
	adj[u].append((v,w))
	adj[v].append((u,w))


q = collections.deque([(1,0)])
h = { 1:0 }
while(q):
	u,c = q.popleft()
	for v,w in adj[u]:
		if v not in h:
			h[v] = (1- c) if (w % 2) else c
			q.append((v,h[v]))

for node in range(1, n + 1): 
	print h[node]
# coding: utf-8
def main():
    A = int(input())
    B = int(input())
    if A > 8 or B > 8:
        print(":(")
    else:
        print("Yay!")

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    A, B = map(int, input().split())
    if A > 8 or B > 8:
        print(":(")
    else:
        print("Yay!")

if __name__ == "__main__":
    main()
import sys
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]

for i in range(M-1):
    if A[i+1] == A[i]+1:
        print(0)
        sys.exit()
        
d = [0]*N
d[0] = 1
d[1] = 1
A = [-1] + A + [N+1]
def func(N):
    if d[N] > 0:
        return d[N]
    d[N] = func(N-1) + func(N-2)
    return d[N]
B = [A[i+1]-A[i]-2 for i in range(M+1)]
ans = 1
for i in range(M+1):
    ans = ans * func(B[i])
ans = ans%1000000007
print(ans)

### FIXED CODE ###

import sys
 
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]+[0] #jがはみ出ないように最後に付け足しておく
MOD=7+10**9 #%MODを忘れない
 
dp=[1]+[0]*n
 
j=0
#iにのぼることができるかを考える
for i in range(1,n+1):
  if i==a[j]:
    j+=1
  elif i>1:
    dp[i] = (dp[i-1] + dp[i-2])%MOD #-1,-2からの遷移を考える
  else:
    if i!=a[0]:
      dp[i] = dp[i-1]

print((dp[-1])%MOD)
import numpy as np

N = int(input())  
A = [int(i) for i in input().split()]

a = np.eye(N, k=0)+np.eye(N, k=1) 
a[N-1,0]=1

inv = np.linalg.inv(a)
A = np.array(A)

ans = 2*np.dot(inv, A)
ans = list(np.array(ans, dtype="int"))

ans=[str(a) for a in ans]
ans=" ".join(ans)
print(ans)	

### FIXED CODE ###

N = int(input())  
A = [int(i) for i in input().split()]

ans = []

sumA = sum(A)
sum_even = 2*sum(A[1 : N : 2])
ans_i = sumA - sum_even
ans.append(ans_i)

for i in range(N-2):
	ans_i = 2*A[i] - ans_i
	ans.append(ans_i)

ans.append(2*A[-1] - ans[0])

ans=[str(a) for a in ans]
ans=" ".join(ans)
print(ans)
import math
from functools import reduce


def maxNumVisitCity(N, X, x):
    d = []
    for i in x:
        d.append(abs(i - X))
    return reduce(math.gcd, d)


def main():
    N, X = map(int, input().split())
    x = map(int, input().split())
    print(maxNumVisitCity(N, X, x))


if __name__ == '__main__':
    main()


### FIXED CODE ###

def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a


def allgcd(d):
    if len(d) == 1:
        return d
    ret_gcd = d[0]
    for i in d:
        ret_gcd = gcd(ret_gcd, i)
    return ret_gcd


def maxNumVisitCity(N, X, x):
    if len(x) == 1:
        return abs(x[0] - X)

    d = []
    for i in x:
        d.append(abs(i - X))
    return allgcd(d)


def main():
    N, X = map(int, input().split())
    x = list(map(int, input().split()))
    print(maxNumVisitCity(N, X, x))


if __name__ == '__main__':
    main()
n = int(input())
  print(n//3)

### FIXED CODE ###

n = int(input())
print(n//3)