Harryxun/stf_run huggingface dataset:
import sys
w = input().lower()
lines = sys.stdin.read()
line=lines[0:lines.find('END_OF_TEXT')].lower().split()
print(line.count(w))

### FIXED CODE ###

import sys
w = input().lower()
lines = sys.stdin.read()
line=lines[0:lines.find('END_OF_TEXT')].lower().split()
print(line.count(w))
N, M = map(int, input().split())
ans = [0 for i in range(M)]
for i in range(N):
  tmp = list(map(int, input().split()))
  #print(tmp)
  for j in range(tmp[0]): #K
    ans[tmp[j]] += 1

count = 0
for k in ans:
  if k == N:
    count += 1
print(count)

### FIXED CODE ###

N, M = map(int, input().split())
ans = [0 for i in range(M)]
for i in range(N):
  tmp = list(map(int, input().split()))
  #print(tmp)
  for j in range(tmp[0]): #K
    ans[tmp[j+1]-1] += 1

count = 0
for k in ans:
  if k == N:
    count += 1
print(count)
N=int(input())
A=list(int(input()))
sum=0
i=0
while i<=N-1:
  sum+=1/A[i]
  i+=1
rev=1/sum
print(rev)


### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
sum=0
i=0
while i<=N-1:
  sum+=1/A[i]
  i+=1
rev=1/sum
print(rev)
n,y = map(int,input().split())

for m in range(0,n):
    for g in range(0,n):
            s = n-m-g
            if s < 0:
                s = 0
            yen = 10000*m + 5000*g + s*1000
            if int(yen) == int(y):
                print("{0} {1} {2}".format(m,g,s))
                sys.exit()

print("-1 -1 -1")


### FIXED CODE ###

n,y=map(int,input().split())
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
        print(i,j,n-i-j)
        exit()
print(-1,-1,-1)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n,k = LI()
    a = LI()
    bi = bisect.bisect_left(a, 0)
    r = inf
    if bi >= k:
        r = abs(a[bi-k])
    if bi+k-1 < n and r > a[bi+k-1]:
        r = a[bi+k-1]
    for i in range(1, min([k-1, bi+1, n])):
        t = -a[bi-i]
        u = a[bi+k-i-1]
        s = t + u + min(t,u)
        if r > s:
            r = s
    return r



print(main())


### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n,k = LI()
    a = LI()
    bi = bisect.bisect_left(a, 0)
    r = inf
    if bi >= k:
        r = abs(a[bi-k])
    if bi+k-1 < n and r > a[bi+k-1]:
        r = a[bi+k-1]
    for i in range(1, n):
        if 0 > bi - i or bi + k - i - 1 >= n or bi + k - i - 1 < bi:
            continue
        t = -a[bi-i]
        u = a[bi+k-i-1]
        s = t + u + min(t,u)
        if r > s:
            r = s
    return r



print(main())
n=int(input())
m=int(input())
if (str(n) in str(m)) == True:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())
a = list(int(x) for x in input().split())
x = 0
 
a.sort()
for i in range(n-1):
    if a[-1] - a[-2] == 0:
        print("NO")
        x = 1
        break
    a.pop()
 
if x == 0:
    print("YES")
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
a = list(map(int, input().split()))
l = 1
m = []

for i in range(10000):
    if a[l - 1] in m: #ループが始まったかどうか
        for j in range(len(m)):
            if m[j] == a[l - 1]:
                cnt = j #ループ開始までの端数
                loop = len(m) - cnt #ループの長さ
                break
    else:
        m.append(a[l - 1])
        l = a[l - 1]
        continue
    break


if (k - cnt)%loop == 0:
    l = loop + cnt - 1
else:
    l = (k - cnt)%loop - 1 + cnt

print(m[l])

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    l = [-1]*n
    now = 0
    order = 0
    l[0] = 0
    s = {}
    ans = -100

    for i in range(n):
        a[i] -= 1

    while k > 0:
        k -= 1
        now = a[now]
        order += 1
        if l[now] != -1: #既に訪問済の場合
            loop = order - l[now]
            k %= loop
        if k == 0:
            ans = now + 1
            break
        l[now] = order #転送順で何番目の町かを記録

    print(max(ans, -1))

main()
import Re
a=input()
b=re.compile('^([^L][^R]*[^L]?)$')
if a.match(b)
print('Yes')
else
print('No')

### FIXED CODE ###

import re #与えられた条件にマッチする文字列か判定
a = input()
b = re.compile(r'^([^L][^R])*[^L]?$')
if b.match(a):
    print('Yes')
else:
    print('No')
import sys
import numpy as np
# 許容する再帰処理の回数を変更
sys.setrecursionlimit(10**5+10)
# input処理を高速化する
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
a = list(map(float, input().split()))
one = a.count(1)
two = a.count(2)
three = a.count(3)

#dp[i][j][k]は残1がi枚、残2がj枚、残3がk枚のときの残り回数の期待値
#dp = [[[0.0 for _ in range(N+1)] for _ in range(N+1)] for _ in range(N+1)]
dp = np.full((N+1, N+1, N+1), -1.0)
dp[0][0][0] = 0.0

def rec(i, j, k):
    if dp[i][j][k] > -1:
        return dp[i][j][k]

    res = 0
    if i > 0:
        res += rec(i - 1, j, k) * i / (i + j + k)
    if j > 0:
        res += rec(i + 1, j - 1, k) * j / (i + j + k)
    if k > 0:
        res += rec(i, j + 1, k - 1) * k / (i + j + k)
    res += N / (i + j + k)
    dp[i][j][k] = res
    return dp[i][j][k]

print(rec(one, two, three))
#print(dp)

### FIXED CODE ###

import sys
# 許容する再帰処理の回数を変更
sys.setrecursionlimit(10**5+10)
# input処理を高速化する
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
a = list(map(float, input().split()))
one = a.count(1)
two = a.count(2)
three = a.count(3)

#dp[i][j][k]は残1がi枚、残2がj枚、残3がk枚のときの残り回数の期待値
dp = [[[0.0 for _ in range(N+1)] for _ in range(N+1)] for _ in range(N+1)]
dp[0][0][0] = 0.0

def rec(i, j, k):
    if dp[i][j][k] > -1:
        return dp[i][j][k]

    res = 0
    if i > 0:
        res += rec(i - 1, j, k) * i / (i + j + k)
    if j > 0:
        res += rec(i + 1, j - 1, k) * j / (i + j + k)
    if k > 0:
        res += rec(i, j + 1, k - 1) * k / (i + j + k)
    res += N / (i + j + k)
    dp[i][j][k] = res
    return dp[i][j][k]

for k in range(three + 1):
    for j in range(two + three + 1 - k):
        for i in range(one + two + three + 1 - k - j):
            if i + j + k == 0:
                continue

            res = 0
            if i > 0:
                res += dp[i - 1][j][k] * i / (i + j + k)
            if j > 0:
                res += dp[i + 1][j - 1][k] * j / (i + j + k)
            if k > 0:
                res += dp[i][j + 1][k - 1] * k / (i + j + k)
            res += N / (i + j + k)
            dp[i][j][k] = res

print(dp[one][two][three])
n=int(input())

h=list(map(int,input()))
if h[-1]==1:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
v = -1
for h in H:
    if v > h:
        if v != h+1:
            print("No")
            exit()
        else:
            v = h+1
    else:
        v = h
print("Yes")
while True:
    if input()=="0 ? 0":
        break
    print(eval(input())

### FIXED CODE ###

while True:
    x=input()
    if "?" in x:
        break
    print(int(eval(x.replace("/","//"))))
def e():
    import numpy as np
 
    N, W = map(int, input().split())
 
    dp = np.zeros(W+1, dtype=np.int64)
 
    for _ in range(N):
        w, v = map(int, input().split())
        np.maximum(dp[:-w]+v, dp[w:], out=dp[w:])
 
    print(dp[-1])
 
 
##########
if __name__ == "__main__":
    e()


### FIXED CODE ###

def b():
    def solve(N, W, V, wv):
        dp = [10**10] * (V+1)
        dp[0] = 0

        for i in range(N):
            wi = wv[i][0]
            vi = wv[i][1]

            # 降順でやらないと複数回アイテムをカウントしちゃう（j1 + wi をやった後に j2 + wi をやると、 j1 + wi == j2 のときに2カウントになってしまう）
            for v in range(V - vi, -1, -1):
                if dp[v] == -1:
                    continue
                if dp[v+vi] > dp[v] + wi:
                    dp[v+vi] = dp[v] + wi

        light = [i for i, w in enumerate(dp) if w <= W]
        return light[-1]

    N, W = map(int, input().split())
    wv = []
    V = 0

    for i in range(N):
        w, v = map(int, input().split())
        wv.append([w, v])
        V += v

    print(solve(N, W, V, wv))

if __name__ == "__main__":
    b()
n = int(input())
t = list(map(int, input().split()))
to = t[0]
if 0 in t:
  print(0)
  exit()
for a in t[1:]:
	to *= a
    if to > 10**18:
	print("-1")
    exit()
else:
  print(to)

### FIXED CODE ###

n = int(input())
t = list(map(int, input().split()))
to = t[0]
if 0 in t:
  print(0)
  exit()
for a in t[1:]:
    to *= a
    if to > (10**18):
        print("-1")
        exit()
print(to)
N, Q = map(int, input().split())
lines = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    lines[a-1].append(b-1)
    lines[b-1].append(a-1)
ans = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    ans[p-1] += x

def dfs(v, parent):
    for u in lines[v]:
        if u != parent:
            ans[u] += ans[v]
            dfs(u, v)

dfs(0, -1)
print (*ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

N, Q = map(int, input().split())
lines = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    lines[a-1].append(b-1)
    lines[b-1].append(a-1)
ans = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    ans[p-1] += x

def dfs(v, parent):
    for u in lines[v]:
        if u != parent:
            ans[u] += ans[v]
            dfs(u, v)

dfs(0, -1)
print (*ans)
import numpy as np
num = int(input())
n = int(np.log10(num))
a =  n * (num // 10 ** n)
print(a)
for i in range(int(n - 2), 1, -1):
    a += i * 9
print(a)


### FIXED CODE ###

N = int(input())

if N % 2 != 0:
    print(0)
    exit()
ans = 0
d = 10
while d <= N:
    ans += N // d
    d *= 5
print(ans)
N, L = map(int, input().split())
S = [input() for i in range(L)]
S.sort()
ans = ''
for i in range(N):
    ans += S[i]
print(ans)

### FIXED CODE ###

n,l = map(int,input().split())
A = [input() for _ in range(n)]
A.sort()
ans = ''
for i in range(n):
    ans += A[i]
 
print(ans)
n = [int(inout()) for _ in [0]*3]
print( int(((n[0]+n[1])*n[2])/2) )

### FIXED CODE ###

n = [int(input()) for _ in [0]*3]
print( int(((n[0]+n[1])*n[2])/2) )
last_name = input()
last_type = last_name[:3]

if last_type == "ABC":
  return "ARC"
else:
  return "ABC"

### FIXED CODE ###

last_name = input()
last_type = last_name[:3]
 
if last_type == "ABC":
  print("ARC")
else:
  print("ABC")
def examE():
    N, T = LI()
    A, B = [0] * N, [0] * N
    for i in range(N):
        A[i], B[i] = LI()
    dp = [[[0,0] for _ in range(T+ 1)] for _ in range(N + 1)]
    for i in range(N):
        for j in range(A[i],T+1):
            dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j - A[i]][0] + B[i])
            dp[i + 1][j][1] = max(dp[i + 1][j][1], dp[i][j - A[i]][1] + B[i])
        for j in range(1,T+1):
            dp[i+1][j][1] = max(dp[i+1][j][1], dp[i][j-1][0] + B[i])
            dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][0])
            dp[i + 1][j][1] = max(dp[i + 1][j][1], dp[i][j][1])
#    print(dp[N][T])
    ans = max(dp[N][T])
    print(ans)

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examE()


### FIXED CODE ###

def examA():
    N = I()
    ans = N*N
    print(ans)

def examB():
    N = I()


import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()
import sympy
n=int(input())
cnt=0
a=sympy.divisors(n)

for i in range(1,len(a)):
    if n%a[i]==0:
        cnt+=1
        n=n/a[i]
print(cnt)


### FIXED CODE ###

n=int(input())

import math

def factorization(n): #nを素因数分解する
    arr = []
    temp = n
    for i in range(2, int(math.sqrt(n))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(cnt)

    if temp!=1:
        arr.append(1)

#    if arr==[]:
#        arr.append([n, 1])  #n=1でarr=[1,1]としたいとき

    return arr

z=factorization(n)

ans=0
for i in range(len(z)):
    for j in range(1,z[i]+1):
        if (z[i]-j)>=0:
            z[i]-=j
            ans+=1
        else:
            break
print(ans)
def fibonacci(n):
    if n == 0 or n == 1:
         F[n] = 1
        return F[n]
    if F[n] is not None:
        return F[n]
    F[n] = fibonacci(n - 1) + fibonacci(n - 2)
    return F[n]


n = int(input())
F = [None] * n

### FIXED CODE ###

def fibonacci(n):
    if n == 0 or n == 1:
        F[n] = 1
        return F[n]
    if F[n] is not None:
        return F[n]
    F[n] = fibonacci(n - 1) + fibonacci(n - 2)
    return F[n]


n = int(input())
F = [None]*(n + 1)
print(fibonacci(n))
N = int(input())
s, t = [0]*N, [0]*N
for i in range(N):
  s[i], t[i] = map(int, input().split())
X = input()

ans = 0
flag = False
for i in range(N):
  if flag:
    ans += t[i]
  if s[i] == X:
    flag = True

print(ans)

### FIXED CODE ###

N = int(input())
s, t = [0]*N, [0]*N
for i in range(N):
  s[i], t[i] = input().split()
X = input()

ans = 0
flag = False
for i in range(N):
  if flag:
    ans += int(t[i])
  if s[i] == X:
    flag = True

print(ans)
S = int(input())
MOD = 10**9 + 7
A = [0] * (S + 1)
A[0] = 1
A[1] = 0
A[2] = 0

cumsum = 1
for i in range(3, len(A)):
    A[i] = cumsum
    cumsum += A[i - 2]
    cumsum %= MOD
print(A[-1])


### FIXED CODE ###

S = int(input())
if S == 1:
    print(0)
    exit()
MOD = 10**9 + 7
A = [0] * (S + 1)
A[0] = 1
A[1] = 0
A[2] = 0

cumsum = 1
for i in range(3, len(A)):
    A[i] = cumsum
    cumsum += A[i - 2]
    cumsum %= MOD
print(A[-1])
X = int(input())
 
score =0
half_x = round(X/2)
 
answer = 0
 
if X < 3:
    print(1)
 
elif X <= 7:
    print(4)
 
else:
    while 1 < half_x:
        half_x -= 1
        
        for p in range(2, 10):
            
            score = pow(half_x,p)
            if score > X:
                continue
        
            if answer < score:
                answer = score
                
    print(answer)

### FIXED CODE ###

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

a = il[0]
b = il[1]
c = il[2]
d = il[3]

connectable = False
#print(abs(a-b))
#print(abs(b-c))
#print(abs(a-c))

if abs(a-b) <= d and abs(b-c) <= d:
    connectable = True
elif abs(a-c) <= d:
    connectable = True
else:
    pass


if connectable:
    print("Yes")
else:
    print("No")
X=int(input())
max=1
else:
  for i in range(1, X):
    for j in range(2, X):
      if i**j<=X:
        max=i**j
      else:
        break
print(max(1, max))

### FIXED CODE ###

X=int(input())
list=[1]
for i in range(1, X):
  for j in range(2, X):
    if (i**j)<=X:
      list.append(i**j)
    else:break
print(max(list))
N,X=map(int,input().split())
inputcities=list(map(int, input().split()))
cities=list(set([abs(inputcities[i]-X) for i in range(N)]))
N=len(cities)
count=0
flag=0
minimum=min(cities)
for j in range(minimum+1)[::-1]:
  for i in range(N):
    if cities[i]%j==0:
      count+=1
    else:
      count=0
      break
    if count==N:
      print(j)
      flag=1
      break
  if flag==1:
    break

### FIXED CODE ###

A,B=map(int,input().split())
if A*B*1%2==1 or A*B*2%2==1 or A*B*3%2==1:
  print("Yes")
else:
  print("No")
A = list(input().split)
B=''
for a in A:
  B += a[0].upper()
print(B)


### FIXED CODE ###

A = list(input().split())
print(A[0][0]+A[1][0]+A[2][0])
N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())
minW = min(w)
for i in range(N):
    w[i] -= minW
MAX_W = 3 * 100
MAX_V = int(1e9)
INF = MAX_V + 2
dp = [[-INF] * (MAX_W + 10) for i in range(N+1)]
dp[0][0] = 0
for i in range(N):
    for j in range(MAX_W, -1, -1):
        for k in range(N-1, -1, -1):
            dp[k+1][j+w[i]] = max((dp[k+1][j+w[i]], dp[k][j] + v[i]))

ans = 0
for i in range(N+1):
    for j in range(i * MAX_W + 1):
        if i * minW + j <= W:
            # print('i * minW: %d, j: %d, dp: %d' % (i*minW, j, dp[i][j]))
            ans = max((ans, dp[i][j]))

print(ans)

### FIXED CODE ###

N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())
minW = min(w)
for i in range(N):
    w[i] -= minW
MAX_W = 3 * 100
MAX_V = int(1e9)
INF = MAX_V + 2
dp = [[-INF] * (MAX_W + 10) for i in range(N+1)]
dp[0][0] = 0
for i in range(N):
    for j in range(MAX_W, -1, -1):
        for k in range(N-1, -1, -1):
            dp[k+1][j+w[i]] = max((dp[k+1][j+w[i]], dp[k][j] + v[i]))

ans = 0
for i in range(N+1):
    for j in range(MAX_W + 1):
        if i * minW + j <= W:
            # print('i * minW: %d, j: %d, dp: %d' % (i*minW, j, dp[i][j]))
            ans = max((ans, dp[i][j]))

print(ans)
a = input() 
b = input()
print a * b 
print 2 * a + 2 * b

### FIXED CODE ###

a, b = map(int, raw_input().split())
print a * b, 2 * a + 2 * b
s=[i for i in input()]
l=[]
cnt=0
for i in s:
  if i=="A" or i=="T" or i=="C" or i=="G" or i==" ":
    cnt+=1
  else:
    l.append(cnt)
    cnt=0
print(max(l) if len(l)>1 else l[0])    

### FIXED CODE ###

s=[i for i in input()]
l=[]
cnt=0
for i in range(len(s)):
  if s[i]=="A" or s[i]=="T" or s[i]=="C" or s[i]=="G" or s[i]==" ":
    cnt+=1
    if i==len(s)-1:
      l.append(cnt)
  else:
    l.append(cnt)
    cnt=0  
print(max(l) if len(l)>1 else l[0])
def main():
    from sys import setrecursionlimit, stdin
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor, gcd
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**9+10

    H,W = LMIIS()
    C = []
    for i in range(10):
        C.append(LMIIS())
    A = []
    for i in range(H):
        A.append(LMIIS())
    
    from copy import deepcopy
    minC = deepcopy(C)
    for i in range(10):
        for j in range(10):
            for k in range(10):
                if minC[i][j] + minC[j][k] < minC[i][k]:
                    minC[i][k] = minC[i][j] + minC[j][k]
    
    ans = 0
    for line in A:
        for a in line:
            if a != -1 and a!= 1:
                ans += minC[a][1]
    print(ans)


    
main()

### FIXED CODE ###

def main():
    from sys import setrecursionlimit, stdin
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**9+10

    H,W = LMIIS()
    C = []
    for i in range(10):
        C.append(LMIIS())
    A = []
    for i in range(H):
        A.append(LMIIS())
    
    from copy import deepcopy
    for m in range(10):
        for f in range(10):
            for t in range(10):
                C[f][t] = min(C[f][t], C[f][m] + C[m][t])


    
    ans = 0
    for line in A:
        for a in line:
            if abs(a) != 1:
                ans += C[a][1]
    print(ans)


    
main()
n = int(input())
numList = list()
for i in range(n):
    numList.append(int(input()))
sum, ctr = 0, 1
for i in numList:
    if i == 0: continue
    else:
        if i % 2 != 0 and ctr % 2 != 0:
            sum = sum + 1
    ctr = ctr + 1
print(sum)

### FIXED CODE ###

n = int(input())
S = list(map(int, input().split()))
ans = 0
for i in range(0, n, 2):
    if i%2 == 0 and S[i]%2 == 1:
        ans += 1
print(ans)
X = int(input())
Y = int(input())

flg = 0
for i in range(1, X):
    j = X - i
    ans = i*2 + j * 4

    if Y == ans:
        print("Yes")
        flg = 1
        break

if flg == 0:
    print("No")


### FIXED CODE ###

X, Y = map(int, input().split())
ans = 'No'

for i in range(X+1):
    j = X - i
    if (i * 2 + j * 4) == Y:
        ans = 'Yes'

print(ans)
h,w=map(int,input().split())
n=int(input())
a=[int(i) for i in input().split()]
s=""
for i in range(n):
  s+=str(i+1)*a[i]
for i in range(h):
  if i%2=0:
    print(*list(s[i*w:i*w+w]))
  else:
    print(*list(s[i*w:i*w+w][::-1]))

### FIXED CODE ###

h,w=map(int,input().split())
n=int(input())
a=[int(i) for i in input().split()]
f=0
d=[]
for i in range(n):
  for j in range(a[i]):
    d.append(i+1)
    if len(d)==w and f:
      print(*d[::-1])
      f=0
      d=[]
    elif len(d)==w:
      print(*d)
      f=1
      d=[]
import numpy as np
n = int(input())
li = list(map(int, input().split()))

ans = np.prod(li)
print(ans) if ans <= 10**18) else print(-1)

### FIXED CODE ###

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

print(x*y)
from collections import deque
a=int(input())
q=deque([1,2,3,4,5,6,7,8,9])
def dfs(k):
  while k=a:
    s=q.popleft()
    if s-1>=0:
      q.aapend(s*10+s-1)
      n=n+1
    q.append(s*10+s)
    k=k+1
    if s+1<=9:
      q.append(s*10+s+1)
      k=k+1
  print(q.pop())

if a<=9:
  print(a)
else:
  dfs(9)
  
    
  
  

### FIXED CODE ###

from collections import deque
a=int(input())
q=deque([1,2,3,4,5,6,7,8,9])
def dfs(k):
  while k<=a:
    s=q.popleft()
    if s%10-1>=0:
      q.append(s*10+s%10-1)
      k=k+1
      if k==a:
        print(q.pop())
    q.append(s*10+s%10)
    k=k+1
    if k==a:
        print(q.pop())
    if s%10+1<=9:
      q.append(s*10+s%10+1)
      k=k+1
      if k==a:
        print(q.pop())
  
 
if a<=9:
  print(a)
else:
  dfs(9)
if abs(a-c)<=d:
    print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
    print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
    print('Yes')
else:
    print('No')
import sys
input = sys.stdin.readline

from math import * 

def main():
    N = int(input())
    A = list(map(int, input().split()))

    ans = 0
    MOD = 10**9+7
    k = 1
    n = ceil(log2(max(A)))
    for i in range(n):
        c = 0
        for j in range(N):
            c += A[j] & 1
            A[j] >>= 1
        ans = (ans + c * (N-c) * k) % MOD
        k = (2*k) % MOD

    print(ans)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
import numpy as np

def main():
    N = int(input())
    A = np.array(list(map(int, input().split())))
    ans = 0
    MOD = 10**9+7
    k = 1
    x = np.max(A)
    n = 1 if x == 0 else int(np.log2(x))+1

    for i in range(n):
        c = np.count_nonzero(A%2)
        A >>= 1
        ans = (ans + c * (N-c) * k) % MOD
        k = (2*k) % MOD

    print(ans)

if __name__ == '__main__':
    main()