Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-

N, K = map(int, input().split())
d = [0]*K

C = [0]*N
for i in range(K):
    d[i]=int(input())
    A=list(map(int, input().split()))
    for j in range(N):
        for k in range(d[i]):
            if A[k]==j+1:
                C[j]=1
                break

count=0
for i in range(N):
    if C[i]==0
    count+1


print("{}".format(count))


### FIXED CODE ###

# -*- coding: utf-8 -*-

N, K = map(int, input().split())
d = [0]*K

C = [0]*N
for i in range(K):
    d[i]=int(input())
    A=list(map(int, input().split()))
    for j in range(N):
        for k in range(d[i]):
            if A[k]==j+1:
                C[j]=1
                break

count=0
for i in range(N):
    if C[i]==0:
        count=count+1

#print("{}".format(C))
print("{}".format(count))
import fractions
from functools import reduce

def gcd(*numbers):
   return reduce(fractions.gcd, numbers)

n=int(input())
al=input().split()
al_i = [int(s) for s in al]
m = max(al_i)
gm = 0

for x in range(n):
   t = al_i[x]
   al_i[x] = m
   g = gcd(*al_i)
   al_i[x] = t
   if g>gm:
      gm = g
print(gm)


### FIXED CODE ###

a,b,t=(int(x) for x in input().split())
print(int((t+0.5)/a)*b)
S=input()
N=len(S)
flag=0
for i in range((N-1)//4):
	if S[i]!=S[(N-1)//2 -i-1]:
		flag=1
		break
	if S[(N+3)//2 +i-1]!=S[N-1-i]:
		flag=1
		break
for j in range((N-1)//2):
	if S[i]!=S[N-1-i]:
		flag=1
		break
if flag==0:
	print("Yes")
else:
	print("No")


### FIXED CODE ###

S=input()
N=len(S)
flag=0
for i in range((N-1)//4):
	if S[i]!=S[(N-1)//2 -i-1]:
		flag=1
		break
	if S[(N+3)//2 +i-1]!=S[N-1-i]:
		flag=1
		break
for j in range((N-1)//2):
	if S[j]!=S[N-1-j]:
		flag=1
		break
if flag==0:
	print("Yes")
else:
	print("No")
n = int(input())

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

Answer = int(0)
for i in range(n-2):
     if L[i]<L[i+1] and L[i+1]<L[i+2]:
             Answer = Answer +1
             continue
    print(Answer)

### FIXED CODE ###

n = int(input())

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

Answer = int(0)
for i in range(n-2):
     if L[i]<L[i+1] and L[i+1]<L[i+2]:
             Answer = Answer + 1
             continue
     if L[i+2]<L[i+1] and L[i+1]<L[i]:
             Answer = Answer + 1
             continue
print(Answer)
a, b, c, k = int(input())

if k <= a:
  print(k)
elif k <= a + b:
  print(a)
else:
  print(a-(k - (a + b)))

### FIXED CODE ###

a, b, c, k = map(int, input().split())

if k <= a:
  print(k)
elif k <= a + b:
  print(a)
else:
  print(a-(k - (a + b)))
N,M,*X = map(int, open(0).read().split())

X.sort()

ans = []
for i in range(len(X)-1):
    ans.append(abs(X[i+1] - X[i]))

if len(ans) == 0:
    print(0)
    sys.exit()

ans.sort()
print(sum(ans[:-(N-1)]))


### FIXED CODE ###

import sys

# N: コマ数
# M: 地点数

N,M,*X = map(int, open(0).read().split())

# コマ数が地点数以上の場合、各地点にコマを配置できる
# よって 0 回の移動で目的を達成できる
if N >= M:
    print(0)
    sys.exit()

X.sort()
ans = []
for i in range(M-1):
    ans.append(abs(X[i+1] - X[i]))

ans.sort(reverse=True)
print(X[-1] - X[0] - sum(ans[:N-1]))
while 1:
    n = input()
    if n == 0:
        break
    s = raw_input()
    lock = 0
    P = []
    for c in s:
        if c is 'u':
            lock = 0
        else:
            P.append((lock, 1 << int(c)))
            lock |= 1 << int(c)
    Q = set()
    i = 0; ok = 1
    while i < len(P) and ok:
        lock1, t1 = P[i]
        if lock1 & t1 == t1:
            ok = 0
        for j in xrange(i):
            lock2, t2 = P[j]
            if lock1 & lock2 == 0 and t1 & lock2 == t1:
                if t2 & lock1 == t2:
                    ok = 0
                v = (lock1 | lock2, t2)
                if v not in Q:
                    P.append(v)
        i += 1
    print "SAFE"*ok or "UNSAFE"

### FIXED CODE ###

while 1:
    n = input()
    if n == 0:
        break
    s = raw_input()
    Q = set()
    lock = 0
    P = []
    for c in s:
        if c is 'u':
            lock = 0
        else:
            v = (lock, 1 << int(c))
            if v not in Q:
                P.append(v)
                Q.add(v)
            lock |= 1 << int(c)
    i = 0; ok = 1
    while i < len(P) and ok:
        lock1, t1 = P[i]
        if lock1 & t1 == t1:
            ok = 0
        for j in xrange(i):
            lock2, t2 = P[j]
            if lock1 & lock2 == 0 and t1 & lock2 == t1:
                if t2 & lock1 == t2:
                    ok = 0
                v = (lock1 | lock2, t2)
                if v not in Q:
                    P.append(v)
                    Q.add(v)
        i += 1
    print "SAFE"*ok or "UNSAFE"
import math
import sys
sys.setrecursionlimit(1000000)
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


N,K = [int(x) for x in input().split()]
R = N-K
mod = 10**9+7
for i in range(1,K+1):
    ans = 0
    if(i==1):
        ans = R+1
    else:
        ans = combinations_count(K-1,i-1)*math.factorial(R+1)//math.factorial(R-(i-1))//math.factorial(i)
    print(ans%mod)


### FIXED CODE ###

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def nPr(n,r):
    num = 1
    for i in range(n,n-r,-1):
        num*=i
    return num

N,K = [int(x) for x in input().split()]
R = N-K
mod = 10**9+7
for i in range(1,K+1):
    ans = 0
    if(i==1):
        ans = R+1
    else:
        if(R==i-1):
            ans = combinations_count(K-1,i-1)
        elif(R<i-1):
            ans = 0
        else:
            ans = combinations_count(K-1,i-1)*math.factorial(R+1)//math.factorial(R-(i-1))//math.factorial(i)
    print(ans%mod)
import math
N,M = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
grid = [[None]*M]*N

#行を表すもの N y A
#列を表すもの M x B
#リストの中で重複があるかどうかの確認する関数。
#Aの中、もしくはBの中で重複がある場合はans=0となる。
def is_unique2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) == len(unique_list)

ans = 1 
count =0
countx=0
county=0
if is_unique2(A) and is_unique2(B):
  
  maxnumber = N*M
  for num in range(N*M,0,-1):
    gridx = -1
    gridy = -1
    
    #numがBに存在していれば、その添字をgridxに保存。存在していなければgridx=-1
    #Aについても同様。
    for x in range(M):
      if num == B[x]:
        gridx=x
        break
    for y in range(N):
      if num == A[y]:
        gridy=y
        break
    
#    print(gridx,gridy)
    
    #gridxとgridyが存在しているときはnumを埋めるところが確定する。
    if 0<=gridx<=M and 0<=gridy<N:
      grid[gridx][gridy]=num
      countx += 1
      county += 1
      count +=1
    #gridxのみ存在しているときはnumを埋めるところが確定するわけではない。
    #countyの数だけnumを埋める場所が存在する。
    elif 0<=gridx<=M:
      ans *= county
      countx += 1
      count +=1
    #gridyのみ存在しているときはnumを埋めるところが確定するわけではない。
    #countxの数だけnumを埋める場所が存在する。
    elif 0<=gridy<=N:
      ans *= countx
      county += 1
      count +=1
      
    #gridx,gridyともに存在しないときはcounty*countx-countをかける。
    #countxとcountyが埋まりきったら答えを出して終了。
    else:
      if not(countx == M and county==N):  
        ans=ans*((county)*(countx)-count)
        count +=1
      else:
        print(ans*math.factorial(N*M-count)%1000000007)
        break
      
  
else:
  print(0)

### FIXED CODE ###

import math
N,M = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
 
#行を表すもの N y A
#列を表すもの M x B
#リストの中で重複があるかどうかの確認する関数。
#Aの中、もしくはBの中で重複がある場合はans=0となる。
def is_unique2(seq):
    seen = []
    unique_list = [x for x in seq if x not in seen and not seen.append(x)]
    return len(seq) == len(unique_list)
 
ans = 1 
count =0
countx=0
county=0
if is_unique2(A) and is_unique2(B):
  
  maxnumber = N*M
  for num in range(N*M,0,-1):
    gridx = -1
    gridy = -1
    
    #numがBに存在していれば、その添字をgridxに保存。存在していなければgridx=-1
    #Aについても同様。
    for x in range(M):
      if num == B[x]:
        gridx=x
        break
    for y in range(N):
      if num == A[y]:
        gridy=y
        break
    
#    print(gridx,gridy)
    
    #gridxとgridyが存在しているときはnumを埋めるところが確定する。
    if 0<=gridx<=M and 0<=gridy<N:
      countx += 1
      county += 1
      count +=1
    #gridxのみ存在しているときはnumを埋めるところが確定するわけではない。
    #countyの数だけnumを埋める場所が存在する。
    elif 0<=gridx<=M:
      ans *= county
      ans %= 1000000007
      countx += 1
      count +=1
    #gridyのみ存在しているときはnumを埋めるところが確定するわけではない。
    #countxの数だけnumを埋める場所が存在する。
    elif 0<=gridy<=N:
      ans *= countx
      ans %= 1000000007
      county += 1
      count +=1
      
    #gridx,gridyともに存在しないときはcounty*countx-countをかける。
    #countxとcountyが埋まりきったら答えを出して終了。
    else:
      if not(countx == M and county==N):  
        ans=ans*((county)*(countx)-count)
        ans %= 1000000007
        count +=1
      else:
        for i in range(1,N*M-count+1):
          ans *= i
          ans %= 1000000007
        print(ans)
        break
  
else:
  print(0)
#!/usr/bin/env python3
import sys
import numpy as np

def gen_check(N: int, S: "List[str]"):
    tmp = [tuple(s)+tuple(s) for s in S]
    S = np.array(tmp+tmp)
    def check(a, b):
        s = S[a:a+N,b:b+N]
        return np.array_equal(s, s.T)
    return check

def solve(N: int, S: "List[str]"):
    ans = 0
    check = gen_check(N, S)
    for a in range(N):
        if check(a, 0):
            ans += N
    return ans

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(solve(N, S))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import numpy as np

def gen_check(N: int, S: "List[str]"):
    tmp = [tuple(s)+tuple(s) for s in S]
    S = np.array(tmp+tmp)
    def check(a, b):
        s = S[a:a+N,b:b+N]
        return np.array_equal(s, s.T)
    return check

def solve(N: int, S: "List[str]"):
    ans = 0
    check = gen_check(N, S)
    for a in range(N):
        if check(a, 0):
            ans += N
    return ans

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(solve(N, S))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
a, b = [int(x) for x in input().split()]
print([a + b, b - a][int(b % a)])


### FIXED CODE ###

a, b = [int(x) for x in input().split()]
print([a + b, b - a][int(bool(b % a))])
N = int(input())
S,T = (input().stlip)

s=''

for i in range(N):
  s+=S[i]+T[i]
  
print(s)


### FIXED CODE ###

N = int(input())
S, T = input().split()
s = ""
for i in range(N):
  s += S[i] + T[i]
print(s)
def recur(n,h,s,j):
    #print(s,j)
    if s==n:
        return abs(h[n-1]-h[n-2])
    if s==n-1:
     #   print("ret")
        return abs(h[n-1]-h[s-j])
    else:
         
          return abs(h[s]-h[s-j])+min(recur(n,h,s+1,1),recur(n,h,s+2,2))
        
    
n=int(input())
h=list(map(int,input().split()))
print(min(recur(n,h,1,1),recur(n,h,2,2)))

### FIXED CODE ###

n=int(input())
h=list(map(int,input().split()))
dp=[0 for _ in range(n)]
dp[0]=0
dp[1]=abs(h[0]-h[1])
for i in range(2,n):
    x=dp[i-1]+abs(h[i-1]-h[i])
    x1 = dp[i - 2] + abs(h[i - 2] - h[i])
    dp[i]=min(x,x1)
print(dp[-1])
n, m = map(int, input().split())
danger = list(int(input()) for _ in range(m))
danger = [0] + danger + [n]
def fibo(n):
    memo = [-1]*(n+1)
    def _fibo(n):
        if memo[n] != -1:
            return memo[n]
        else:
            if n <= 1:
                memo[n] = n
                return memo[n]
            else:
                memo[n] = _fibo(n-1) + _fibo(n-2)
                return memo[n]
    return _fibo(n)
ans = 1
for j in range(m+1):
    ans *= fibo(danger[j+1] - danger[j] )
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
alis = list(int(input()) for _ in range(m))
dp = [-1]*(n+1)
mod = 10**9 + 7
for i in alis:
    dp[i] = 0
dp[0] = 1
dp[1] = 1 if 1 not in alis else 0
for i in range(2,n+1):
    if dp[i] == -1:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print(dp[n])
import sys

i = 0
x = 1

while x != 0:
  x = sys.stdin.readline()
  i += 1

  print "Case %d: %d", %(i,x)
  

### FIXED CODE ###

i = 0
d = 0

while d == 0:
    x = input()
    if x != 0:
        i += 1
        print("Case %d: %d" %(i, x))
    else:
        d = 1
line=str(input())
line=list(line)
a=line[0]
b=line[1]
c=line[2]
d=line[3]
o1='+'
o2='+'
o3='+'
for x in (a+b,a-b):
  for y in (c,-c):
    for z in (d,-d):
      if x+y+z==7:
        if x==a-b:
          o1='-'
        if y==-c:
          o2='-'
        if z==-d:
          o3='-'
print("{}{}{}{}{}{}{}=7".format(a,o1,b,o2,c,o3,d))


### FIXED CODE ###

line=str(input())
line=list(line)
line=list(map(int,line))
a=line[0]
b=line[1]
c=line[2]
d=line[3]
o1='+'
o2='+'
o3='+'
count=0
for x in (a+b,a-b):
  for y in (c,-c):
    for z in (d,-d):
      if x+y+z==7 and count==0:
        if x==a-b:
          o1='-'
        if y==-c:
          o2='-'
        if z==-d:
          o3='-'
        count+=1
print("{}{}{}{}{}{}{}=7".format(a,o1,b,o2,c,o3,d))
a = input()
b = len(a)
print(a[0]+(b-2)+a[b-1])

### FIXED CODE ###

a = input()
b = len(a)
print(a[0]+str(b-2)+a[b-1])
N=int(input())
a=[[0 for j in range(N-1)] for i in range(N)]
for i in range(N):
  line=list(map(int,input().split()))
  for j in range(N-1):
    a[i][j]=line[j]-1
  a[i]=a[i][::-1]
    
from collections import deque
q=deque()

#seen=[[False for j in range(N)] for i in range(N)]

# 選手nが試合できるならqueに入れる
def check(i):
  if len(a[i])==0:
    return False
  j=a[i][-1]
  if a[j][-1]==i:
    q.append([i,j])
  
for i in range(N):
  check(i)
  
from collections import defaultdict

day=0
while q:
  day+=1
  q=sorted(q)
  prevQ=q.copy()
  q=deque()
  matched=defaultdict(list)
  for p in prevQ:
    i=p[0]
    j=p[1]
    if i>j:
      i,j=j,i
    if matched[i]:
      continue
    a[i].pop()
    a[j].pop()
    check(i)
    check(j)
    matched[i].append(j)
    
for i in range(N):
  if len(a[i])!=0:
    print(-1)
    break
else:
  print(day)

### FIXED CODE ###

N=int(input())
a=[[0 for j in range(N-1)] for i in range(N)]
for i in range(N):
  line=list(map(int,input().split()))
  for j in range(N-1):
    a[i][j]=line[j]-1
  a[i]=a[i][::-1]
    
q=[]

#seen=[[False for j in range(N)] for i in range(N)]

# 選手nが試合できるならqueに入れる
def check(i):
  if len(a[i])==0:
    return False
  j=a[i][-1]
  if a[j][-1]==i:
    q.append([i,j])
  
for i in range(N):
  check(i)
  
from collections import defaultdict

day=0
while q:
  day+=1
 # q=sorted(q)
  prevQ=q.copy()
  q=[]
  matched=defaultdict(list)
  for p in prevQ:
    i=p[0]
    j=p[1]
    if i>j:
      i,j=j,i
    if matched[i]:
      continue
    a[i].pop()
    a[j].pop()
    check(i)
    check(j)
    matched[i].append(j)
    
for i in range(N):
  if len(a[i])!=0:
    print(-1)
    break
else:
  print(day)
data = [x + 1 for x in xrange(30)]
# print(data)

for i in xrange(30):
    a = int(raw_input())

    data.remove(a)
#     print(data)

for i in data:
    print(i)

### FIXED CODE ###

data = [x + 1 for x in xrange(30)]
# print(data)

for i in xrange(28):
    a = int(raw_input())

    data.remove(a)
#     print(data)

for i in data:
    print(i)
N = input()
k = len(N)
mod = 10**9+7
def mthd(n):
    x = format(n,"b")
    ln = len(x)
    if x == "1":
        return 3
    elif x == "0":
        return 1
    elif n == 2**(ln)-1:
        return pow(3,ln,mod)
    else:
        l = 2**(ln-1)
        s = n % l
        return (mthd(s)*2+mthd(l-1)) % mod
print(mthd(int(N,2)))

### FIXED CODE ###

N = input()
k = len(N)
mod = 10**9+7
DP = [[0,0] for i in range(k+1)]
DP[0][0] = 1
DP[0][1] = 0
for i in range(1,k+1):
    if N[i-1] == "1":
        DP[i][0] = (DP[i-1][0]*2)%mod
        DP[i][1] = (DP[i-1][1]*3+DP[i-1][0])%mod
    if N[i-1] == "0":
        DP[i][0] = DP[i-1][0]
        DP[i][1] = (DP[i-1][1]*3)%mod
print((DP[k][0]+DP[k][1])%mod)
N,X = list(map(int,input().split(' ')))
L = list(map(int,input().split(' ')))[:N]

p = 0
count = 1

for i in range(1,N):
    p += L[i]
    if p <= X:
        count += 1
print(count)


### FIXED CODE ###

x,a = list(map(int,input().split(' ')))
if x < a:
  print(0)
else:
  print(10)
n=int(input())
n2=0
if n%2==1:
	print(0)
else:
	n2=n/2
	ans=0
	while n2>0:
		n2=n2//5
		ans+=n2
print(int(ans))

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    n=int(input())
    cnt=5
    ans=0
    if n%2==0:
        n=n//2
        while cnt<=n:
            ans+=n//cnt
            cnt*=5
    print(ans)                
    
if __name__ == '__main__':
    main()
N,M = map(int,input().split(' '))
A = list(map(int,input().split(' ')))
B =[]
C =[]

l = [list(map(int,input().split())) for i in range(M)]

A.sort()
l = sorted(l,key = lambda x:x[1])

ttl = 0
m_score = 0
flag =False
for i in l[::-1]:
    p = i[0]
    k = i[1]
    ttl+=p
    t = ttl-1
    if t>=N:
        for n,j in enumerate(i[t-p+1:]):
            if j<k:
                m_score+=p
                break
        m_score += sum(A[t-p+1+n:])
        break
    if A[t]<k:
        m_score += p*k
        continue
    else:
        for n,j in enumerate(A[t-p+1:t+1]):
            if j>k:
                flag = True
                break
        if flag:
            m_score += k*n+sum(A[t-p+1+n:])
            break
if not flag:
    if ttl<N:
        m_score += sum(A[ttl:])
print(m_score)

### FIXED CODE ###

N,M = map(int,input().split(' '))
A = list(map(int,input().split(' ')))
l = [list(map(int,input().split())) for i in range(M)]

A.sort()
l = sorted(l,key = lambda x:x[1])

ind =0
for b,c in l[::-1]:
    mx = min(N,ind+b)
    for i in range(ind,mx):
        if c>A[i]:
            A[i] = c
    if mx==N:
        break
    ind += b
print(sum(A))
import sys
input = sys.stdin.readline
import numpy as np

s = input()[:-1]

cnts = []

tmp = 1
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        tmp += 1
    else:
        if s[i] == '>':
            tmp *= -1
        cnts.append(tmp)
        tmp = 1

if s[i] == '>':
    tmp *= -1
cnts.append(tmp)

idx = 0
a = [0] * (len(s)+1)
for i in range(len(cnts)):
    base = 0
    if i != 0 and cnts[i-1] > 0 and cnts[i] < 0 and a[idx-1] >= abs(cnts[i]):
        base = a[idx-1] - abs(cnts[i])
    for j in range(abs(cnts[i])):
        if cnts[i] > 0:
            a[idx] = j
        else:
            a[idx] = abs(cnts[i]) - j + base
        idx += 1
# print(*cnts)
# print(*a)
print(sum(a))
# for i in range(len(s)):
#     print(a[i],s[i],end='')
# print(a[-1])

### FIXED CODE ###

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

s = input()[:-1]

cnts = []

tmp = 1
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        tmp += 1
    else:
        if s[i] == '>':
            tmp *= -1
        cnts.append(tmp)
        tmp = 1

if s[-1] == '>':
    tmp *= -1
cnts.append(tmp)

idx = 0
a = [0] * (len(s)+1)

for i in range(len(cnts)):
    if i != 0 and cnts[i-1] > 0 and cnts[i] < 0 and a[idx-1] >=  abs(cnts[i]):
        a[idx] = a[idx-1] + 1

    for j in range(abs(cnts[i])):
        if a[idx] != 0:
            idx += 1
            continue
        if cnts[i] > 0:
            a[idx] = j
        else:
            a[idx] = abs(cnts[i]) - j
        idx += 1
if s[-1] == '<':
    a[-1] = a[-2] + 1

# print(*cnts)
# print(*a)
print(sum(a))
# for i in range(len(s)):
#     print(a[i],s[i],end='')
# print(a[-1])
import sys
def input(): return sys.stdin.readline().rstrip()
    
def main():
    n,m=map(int,input().split())
    A=[int(input())for _ in range(m)]
    flag=[True]
    for a in A:
        flag[a]=False
    mod=10**9+7
    dp=[0]*(n+1)
    dp[0]=1
    for i in range(n):
        if flag[i+1]:
            dp[i+1]+=dp[i]%mod
        if flag[i+2] and i<n-1:
            dp[i+2]+=dp[i]%mod
    print(dp[n]%mod)

if __name__=='__main__':
    main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()
    
def main():
    n,m=map(int,input().split())
    A=[int(input())for _ in range(m)]
    flag=[True]*(n+2)
    for a in A:
        flag[a]=False
    mod=10**9+7
    dp=[0]*(n+1)
    dp[0]=1
    for i in range(n):
        if flag[i+1]:
            dp[i+1]+=dp[i]%mod
        if flag[i+2] and i<n-1:
            dp[i+2]+=dp[i]%mod
    print(dp[n]%mod)

if __name__=='__main__':
    main()
a,b,c= (int,input().split())
print(a*b/2)

### FIXED CODE ###

a,b,c= map(int,input().split())
print(a*b//2)
n,k = map(int,input().split())

if n%k = 0:
  print(0)
else:
  print(1)

### FIXED CODE ###

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

if n%k == 0:
  print(0)
else:
  print(1)
import itertools
costs = [int(x) for x in input().split()]
ans = 1000000000000
for x in itertools.permutations([0, 1, 2, 3, 4]):
  c = 0
  for i in range(0, 5):
    c += costs[x[i]]
    if i != 4 && c % 10 != 0:
      c += 10 - c % 10
  ans = min(c, ans)
print(ans)

### FIXED CODE ###

import itertools
costs = [int(input()) for _ in range(0, 5)]
ans = 1000000000000
for x in itertools.permutations([0, 1, 2, 3, 4]):
  c = 0
  for i in range(0, 5):
    c += costs[x[i]]
    if i != 4 and c % 10 != 0:
      c += 10 - c % 10
  ans = min(c, ans)
print(ans)
A, B, K = map(int, input().split())
ans=[1]
for i in range(2,int(max([A,B]))):
        if A%i== 0 and B%i == 0:
            ans.append(i)
ans.sort(reverse=True)
print(ans[K-1])

### FIXED CODE ###

A, B, K = map(int, input().split())
ans=[1]
for i in range(2,int(max([A,B])+1)):
        if A%i== 0 and B%i == 0:
            ans.append(i)
ans.sort(reverse=True)
print(ans[K-1])
a=int(input())
x = list(map(str,input().split()))
x = [0]+x+[0]
s = 0
for i in range(1,a+2):
    s+=abs(x[i-1]-x[i])
for i in range(1,a+1):
    print(s+abs(x[i-1]-x[i+1])-(abs(x[i-1]-x[i])+abs(x[i]-x[i+1])))


### FIXED CODE ###

a=int(input())
x = list(map(int,input().split()))
x = [0]+x+[0]
s = 0
for i in range(1,a+2):
    s+=abs(x[i-1]-x[i])
for i in range(1,a+1):
    print(s+abs(x[i-1]-x[i+1])-(abs(x[i-1]-x[i])+abs(x[i]-x[i+1])))
import sys
input = sys.stdin.readline
 
#a,b,c = list(map(int,input().split()))
 
a = list(input())

ans = 0

for dig in a:
  ans += int(dig)
  
if ans % 9 ==0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
#a,b,c = list(map(int,input().split()))
 
a = list(input().rstrip())

ans = 0

for dig in a:
  ans += int(dig)
  
#print(ans)
  
if ans % 9 ==0:
  print('Yes')
else:
  print('No')
#!/usr/bin/env python3
def right_triangle(edge):
    # a < b < c
    return (edge[0] ** 2 + edge[1] ** 2 == edge[2] ** 2)

n = int(input())
for i in range(n):
    edge = sorted([int(x) for x in input().split()])
    if right_triangle(edge):
        print("YES")
    else:
        print("NO")

### FIXED CODE ###

#!/usr/bin/env python3
def right_triangle(edge):
    # a < b < c
    return (edge[0] ** 2 + edge[1] ** 2 == edge[2] ** 2)

n = int(input())
for i in range(n):
    edge = sorted([int(x) for x in input().split()])
    if right_triangle(edge):
        print("YES")
    else:
        print("NO")
from sympy import sieve

x = int(input())

while True:
    if x in sieve:
        print(x)
        break
    x += 1


### FIXED CODE ###

import math
x = int(input())

def is_prime(x):
    if x < 2: return False # 2未満に素数はない
    if x == 2 or x == 3 or x == 5: return True # 2,3,5は素数
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False # 2,3,5の倍数は合成数

    # ためし割り: 疑似素数(2でも3でも5でも割り切れない数字)で次々に割っていく
    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True

while True:
    if is_prime(x):
        print(x)
        break
    x += 1