Harryxun/stf_run huggingface dataset:
import numpy as np

x, n = map(int, input().split())
if n == 0:
    print(x)
else:
    lists = list(map(int, input().split()))
    lists_arr = np.array(lists)

    max = lists_arr.max()
    min = lists_arr.min()
    number_lists = list(range(min, max+1, 1))
    existing = number_lists.copy()
    for i in lists:
        existing.remove(i)
    existing_arr = np.array(existing)
    if x > max or x < min:
        print(x)
    else:
        if x <= existing_arr.min():
            print(existing_arr.min())
        elif x >= existing_arr.max():
            print(existing_arr.max())

### FIXED CODE ###

import numpy as np

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

all_num = list(range(0, 102, 1))
lists = [i for i in all_num if i not in num_lists]

lists_arr = np.array(lists)
diff_arr = lists_arr - x
abs_arr = np.abs(diff_arr)
index = np.where(abs_arr == abs_arr.min())
answer_list = lists_arr[index]
print(answer_list[0])
n=input();print n*800-n//15*200

### FIXED CODE ###

n=int(input());print(n*800-n//15*200)
N,M=map(int,input().split())
mod = 10**9+7
fram = [1]
for i in range(1,N+1):
  fram.append(fram[-1]*i%mod)

#def framod(n, mod, a=1):
#    for i in range(1,n+1):
#        a = a * i % mod
#    return a

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

def comb(n, k, mod):
    a=fram[n]
    b=fram[k]
    c=fram[n-k]
    return (a * power(b, mod-2, mod) * power(c, mod-2, mod)) % mod

def cnt(n):
  s = sum([comb(n-i,i,mod)%mod for i in range(n//2+1)])
  s = s%mod
  return s

A0 = 0
ans = 1
for i in range(M):
  A1 = int(input()) - 1
  ans = (ans * cnt(A1-A0))%mod
  A0 = A1+2
ans = (ans * cnt(N-A0))%mod
print(ans)


### FIXED CODE ###

N,M=map(int,input().split())
S = []
for i in range(M):
  S.append(list(map(int,input().split())))
P = list(map(int,input().split()))

def check(num, i, P):
  SS = S[i]
  PP = P[i]
  on = 0
  for j in range(1,1+SS[0]):
    on += num>>(SS[j]-1) & 1
    on = on%2
  if on == PP:
    return True
  else:
    return False
cnt = 0
for nu in range(2**N):
  ck = True
  for i in range(M):
    ck = ck and check(nu,i,P)
    if ck == False:
      break
  if ck == True:
    cnt +=1
print(cnt)
a = str(input())
if a = str.isupper():
  print("A")
else:
  print("a")

### FIXED CODE ###

α = input()
if α.islower():
  print("a")
else:
  print("A")
n, k = map(int, input().split())
s = list(input())

s_c = []

left = 0
right = 0
for i in range(n - 1):
    if s[i] == s[i + 1]:
        right = i + 1
    else:
        s_c.append(''.join(s[left:right + 1]))
        i += 1
        left = i
        right = i
s_c.append(''.join(s[left:right + 1]))

cc = 'R'
if s_c[1][0] == 'R':
    cc = 'L'
for i in range(k):
    s_c[2 * i + 1] = cc * len(s_c[2 * i + 1])

ans_s = ''.join(s_c)
ans = 0
for i in range(n):
    if ans_s[i] == 'R' and i != n - 1 and ans_s[i + 1] == 'R':
        ans += 1
    elif ans_s[i] == 'L' and i != 0 and ans_s[i - 1] == 'L':
        ans += 1
print(ans)


### FIXED CODE ###

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

s_c = []

left = 0
right = 0
for i in range(n - 1):
    if s[i] == s[i + 1]:
        right = i + 1
    else:
        s_c.append(''.join(s[left:right + 1]))
        i += 1
        left = i
        right = i
s_c.append(''.join(s[left:right + 1]))

s_c_len = len(s_c)
cc = 'R'
if s_c_len > 1 and s_c[1][0] == 'R':
    cc = 'L'

for i in range(k):
    if (2 * i + 1) > s_c_len - 1:
        break
    s_c[2 * i + 1] = cc * len(s_c[2 * i + 1])

ans_s = ''.join(s_c)
ans = 0
for i in range(n):
    if ans_s[i] == 'R' and i != n - 1 and ans_s[i + 1] == 'R':
        ans += 1
    elif ans_s[i] == 'L' and i != 0 and ans_s[i - 1] == 'L':
        ans += 1
print(ans)
s = input()

s1 = s[0].int()
s2 = s[1].int()
s3 = s[2].int()

print(str(s1+s2+s3))


### FIXED CODE ###

s = input()

s1 = int(s[0])
s2 = int(s[1])
s3 = int(s[2])

print(str(s1+s2+s3))
import math


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


a, b = list(map(int, input().split()))
g = math.gcd(a, b)
if g == 1:
    print(factorization(g))
    print('1')
else:
    print(factorization(g))
    print(len(factorization(g))+1)

### FIXED CODE ###

n = int(input())
p = 0
for i in range(n+1):
    if i % 2 == 1:
        p += 1
print('{:.10}'.format(p/n))
s = input()
if s[0]!="A":
  print("WA")
  exit()
else:
  s.pop(0)
  
count =0
for i in range(1,-2):
  if s[i] == "C":
    s.pop(i)
    count+=1
  else:
    continue
    
if count !=1:
  print("WA")
  exit()
else:
  continue
  
if s.islower():
  print("AC")
else:
  print("WA")

### FIXED CODE ###

s = list(input())
flg = "WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s = ''.join(s)
    if s.islower()==True:
      flg = "AC"
print(flg)
import sys
count = 1
while True:
  x,y = sys.stdin.readline().split()
  if x == 0 and y == 0:
    break

  if x > y:
    print(y,x)
  print(x,y)
  count = count + 1  

### FIXED CODE ###

import sys
while True:
    a,b=map(int,sys.stdin.readline().split())
    if a==0 and b==0:
        break
    if a<b:print(a,b)
    else:print(b,a)
s=input()
sento1 = 0
sento0 = 0
for i in range(len(s)):

  if i % 2 == 0:
    
    if s[i] == '1':
      sento1 += 1
      
    elif s[i] == '0':
      sento0 += 1
      
  else:
    if s[i] == '0':
      sento1 += 1
    elif s[i] == '1'
      sento0 += 1
      
print(min(sento1,sento0))

### FIXED CODE ###

s=input()
sento1 = 0
sento0 = 0
for i in range(len(s)):

  if i % 2 == 0:
    
    if s[i] == '1':
      sento1 += 1
      
    elif s[i] == '0':
      sento0 += 1
      
  else:
    if s[i] == '0':
      sento1 += 1
    elif s[i] == '1':
      sento0 += 1
      
print(min(sento1,sento0))
N, K = map(int, input().split())

# x_1 + x_2 + ... x_k = n
# x_i >= 0
# k個の箱にn個のボールを入れる重複組み合わせ　n+k-1_C_k-1
# n個の玉とk-1個の仕切りを並べる

# x_1 + x_2 + ... x_k = n
# x_i >= 1
# k個の箱にn個のボールを1個以上入れる重複組み合わせ　n-1_C_k-1
# n個の玉の仕切りn-1個の中に、k-1箇所仕切りを入れる

from math import factorial

# k = 1,2,...,K
for k in range(1, K + 1):
    if k > N - K + 1:
        print(0)
        continue

    # k = 1,2,...,K
    # K個の青いボールをk個に分割する方法
    # K-1_C_k-1
    c1 = factorial(K - 1) / factorial(K - k) / factorial(k - 1)
    c1 = int(c1) % (10 ** 9 + 7)

    # N-K個の赤いボールの分割
    # k+1個に分割(しかし両端はなくても良い)
    # N-K+1_C_k

    # x_1 + x_2 + ... + x_k + x_k+1 = N−K
    # x1 >= 0
    # x_2,x_3,...,x_k >= 1
    # x_k + 1 >= 0

    c2 = factorial(N - K + 1) / factorial(N - K - k + 1) / factorial(k)
    c2 = int(c2) % (10**9 + 7)

    ans = c1 * c2 % (10**9 + 7)
    print(ans)


### FIXED CODE ###

N, K = map(int, input().split())

# x_1 + x_2 + ... x_k = n
# x_i >= 0
# k個の箱にn個のボールを入れる重複組み合わせ　n+k-1_C_k-1
# n個の玉とk-1個の仕切りを並べる

# x_1 + x_2 + ... x_k = n
# x_i >= 1
# k個の箱にn個のボールを1個以上入れる重複組み合わせ　n-1_C_k-1
# n個の玉の仕切りn-1個の中に、k-1箇所仕切りを入れる

from math import factorial

# k = 1,2,...,K
for k in range(1, K + 1):
    if k > N - K + 1:
        print(0)
        continue

    # k = 1,2,...,K
    # K個の青いボールをk個に分割する方法
    # K-1_C_k-1
    c1 = factorial(K - 1) // (factorial(K - k) * factorial(k - 1))
    c1 = int(c1) % (10 ** 9 + 7)

    # N-K個の赤いボールの分割
    # k+1個に分割(しかし両端はなくても良い)
    # N-K+1_C_k

    # x_1 + x_2 + ... + x_k + x_k+1 = N−K
    # x1 >= 0
    # x_2,x_3,...,x_k >= 1
    # x_k + 1 >= 0

    c2 = factorial(N - K + 1) // (factorial(N - K - k + 1) * factorial(k))
    c2 = int(c2) % (10**9 + 7)

    ans = c1 * c2 % (10**9 + 7)
    print(ans)
n, p = map(int,input().split())
D = input()
count = [0] * p
out = 0

if 10 % p == 0:
    for i, d in enumerate(D):
        if int(d) % p == 0:
            out += i + 1
else:
    ten = 1
    count[0] = 1
    for i in range(n):
        mod = (mod + int(D[n-i-1]) * ten) % p
        count[mod] += 1
        ten *= 10
    for c in count:
        out += (c * (c - 1)) // 2
print(int(out))

### FIXED CODE ###

n, p = map(int,input().split())
D = input()
out = 0


if 10 % p == 0:
    for i in range(n):
        if int(D[i]) % p == 0:
            out += i + 1
else:
    mod = 0
    count = [0] * p
    ten = 1
    count[mod] += 1
    for i in range(n):
        mod = (mod + int(D[n-i-1]) * ten) % p
        ten = ten * 10 % p
        count[mod] += 1
    for c in count:
        out += (c * (c - 1)) // 2
print(out)
n,k=map(int,input().split())
x=[c for c in range(1,n+1)]
for i in range(1,k+1):
  d=int(input())
  s=input().split()
  for b in range(d):
    if int(s[b]) in x:
      x.remove(int(s_i[b]))
print(len(x))


### FIXED CODE ###

n,k=map(int,input().split())
x=[c for c in range(1,n+1)]
for i in range(1,k+1):
  d_i=int(input())
  s_i=input().split()
  for b in range(d_i):
    if int(s_i[b]) in x:
      x.remove(int(s_i[b]))
print(len(x))
a = input()
count = 0

count += 1 if a[0] == 1
count += 1 if a[1] == 1
count += 2 if a[2] ==1
print(count)
  

### FIXED CODE ###

a = input()
count = 0
if a[0] == "1":
  count += 1
if a[1] == "1":
  count += 1
if a[2] == "1":
  count += 1
print(count)
a,b=(int,input().split())

if(a==1):
  a=14
if(b==1):
  b=14
  
if(a>b):
  print("Alice")
elif(a<b):
  print("Bob")
else:
  print("Drow")

### FIXED CODE ###

a,b=map(int,input().split())
if(a==1):
  a=14
if(b==1):
  b=14

if(a>b):
  print("Alice")
elif(a<b):
  print("Bob")
else:
  print("Draw")
m = int(input())

def fizz_buzz(i):
  fizz = i % 3
  buzz = i % 5
  
  return (fizz > 0) && (buzz > 1)

res = 0

for i in range(m):
  use_i = i+1
  if fizz_buzz(use_i):
    res += use_i
    
print(res)

### FIXED CODE ###

m = int(input())
     
def fizz_buzz(i):
  fizz = i % 3
  buzz = i % 5
      
  return (fizz > 0) & (buzz > 0)
     
res = 0
     
for i in range(m):
  use_i = i+1
  if fizz_buzz(use_i):
    res += use_i
        
print(res)
import numpy as np
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * n
for i, num in enumerate(a):
    if flag[i]:
        for j in range(i+1, n):
            if a[j]%num == 0:
                flag[j] = False
print(int(np.count_nonzero(flag)))

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * (a[-1]*3)
for i, num in enumerate(a):
    if a[(i-1)%n]==num or a[(i+1)%n]==num:
        if i-1>=0 or i+1<n:
            flag[num] = False
    for j in range(2, a[-1]//num+2):
        flag[j*num] = False
counter = 0
for i in a:
    if flag[i]:
        counter += 1
print(counter)
n = int(input())
s = int(input())

flag = False
if s > n:
  print(-1)
  exit()

if s == n:
  print(n+1)
  exit()

def chk(b, n):
  if n//b == 0:
    return n
  else:
    return chk(b,n//b) + n%b

for b in range(2, int(n**0.5)+1):
  if chk(b, n) == s:
    print(b)
    flag = True
    exit()

for i in range(int(n**0.5), 0, -1):
  b = (n-s)//i + 1
  if chk(b, n) == s:
    print(b)
    flag = True
    exit()

if flag == False:
  print(-1)

### FIXED CODE ###

n = int(input())
s = int(input())

flag = False
if s > n or (n//2)+1<s<n:
  print(-1)
  exit()
  
if s == n:
  print(n+1)
  exit()

def chk(b, n):
  if n//b == 0:
    return n
  else:
    return chk(b,n//b) + n%b

for b in range(2, int(n**0.5)+1):
  if chk(b, n) == s:
    print(b)
    flag = True
    exit()

for i in range(int(n**0.5), 0, -1):
  b = (n-s)//i + 1
  if chk(b, n) == s:
    if b > 1:
      print(b)
      flag = True
      exit()

if flag == False:
  print(-1)
def typical_stairs():
    n, m = map(int, input().split())
    dangerous = list(int(input()) for _ in range(m))
    mod = 1000000007
    dp = [0] * (n + 1)
    dp[0] = 1
    if not dangerous[0] == 1:
        dp[1] = 1
    else:
        dp[1] = 0
    for i in range(2, n + 1):
        if i not in dangerous:
            dp[i] = dp[i - 2] + dp[i - 1]
    print(dp[-1] % mod)


if __name__ == '__main__':
    typical_stairs()


### FIXED CODE ###

def typical_stairs():
    n, m = map(int, input().split())
    dangerous = set(int(input()) for _ in range(m))
    mod = 1000000007
    dp = [0] * (n + 1)
    dp[0] = 1
    if 1 not in dangerous:
        dp[1] = 1
    for i in range(2, n + 1):
        if i not in dangerous:
            dp[i] = dp[i - 2] + dp[i - 1]
    print(dp[-1] % mod)


if __name__ == '__main__':
    typical_stairs()
merry=[4,1,4,1,2,1,2,1]
while True:
    try:
        gst=map(int,raw_input().split())
    except EOFError:
        break
    m=10000
    ans=set()
    for i in range(len(merry)):
        temp=merry[i:]+merry[:i]
        s=sum([gst[i]-temp[i] for i in range(len(merry)) if gst[i]>temp[i]])
        if s<m:
            m=s
            ans.clear()
            ans.add("".join(map(str,temp)))
        if s==m:
            ans.add("".join(map(str,temp)))
    print " ".join(min(ans))

### FIXED CODE ###

c=[4,1,4,1,2,1,2,1]
while True:
    try:
        p=map(int,raw_input().split())
    except EOFError:
        break
    m,ans=100000000,"9"*10
    for i in range(len(c)):
        t=c[i:]+c[:i]
        s=sum([p[i]-t[i] for i in range(len(c)) if p[i]>t[i]])
        if (s<m) or (s==m and int(ans)>int("".join(map(str,t)))):
            m=s
            ans="".join(map(str,t))
    print " ".join(ans)
s = input()
ans = []
for i in s:
    if i =='0' or i == '1':
        ans.append(i)
    elif i == 'B':
        del ans[-1]
print(''.join(ans))

### FIXED CODE ###

string = []
S = input()
for i in S:
    if i == '0':
        string += '0'
    elif i == '1':
        string += '1'
    elif i == 'B':
        if len(string) == 0:
            pass
        else:
            del string[-1]
print(''.join(string))
MOD = 10 ** 5
n, m = map(int, input().split())
kyori = [int(input()) for _ in range(n - 1)]
a = [int(input()) for _ in range(m)]
rui = [0] * n
for i in range(n - 1):
    rui[i + 1] = rui[i] + kyori[i]

ans = 0
tmp = 0
for i in range(m):
    ans += abs(rui[tmp] - rui[tmp + a[i]])
    tmp += a[i] % MOD

print(ans % MOD)

### FIXED CODE ###

inData = input().split(' ')

ans = 0
count = 0
maxCount = int(inData[2])
many = int(inData[1])
nedan = int(inData[0])

for i in range(0, maxCount):
    if nedan <= many:
        if count < maxCount:
            ans += 1
            many -= nedan
        else:
            break
    else:
        break

print(ans)
A=int(input())
B=int(input())
if 1<=A<=9, 1<=B<=9:
  print("A*B")
else:
  print("-1")

### FIXED CODE ###

a,b=map(int,input().split())
if a>=10 or b>=10:
  print(-1)
else:
  print(a*b)
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n-r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


N, k = map(int, input().split())
for i in range(1, k+1):
    t = N-k+1
    count = cmb(t, i) * cmb(k-1, i-1) % (10**9 + 7)
    print(count)


### FIXED CODE ###

from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n-r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


N, k = map(int, input().split())
if N == k:
    print(1)
    for i in range(N-1):
        print(0)
    exit()

for i in range(1, k+1):
    t = N-k+1
    if i > t:
        print(0)
        continue
    count = cmb(t, i) * cmb(k-1, i-1) % (10**9 + 7)
    print(count)
r = input()
bai = r*r/1
print (bai)

### FIXED CODE ###

r = int(input()) 
print (r*r)
def main():
	N, M = map(int, input().split())
	S = {}
	for i in range(N):
		a, b = map(int, input().split())
		S[a] = b
	sorted_price_list = sorted(S)
	cost = 0
	for i in range(N):
		a = sorted_price_list[i]
		mc = S[a]
		if M <= mc:
			for i in range(mc):
				M -= 1
				cost += a
				if M <= 0:
					print(cost)
					return
		else:
			M -= mc
			cost += a * mc
	return

if __name__ == '__main__':
	main()


### FIXED CODE ###

def main():
	N, M = map(int, input().split())
	S = []
	for i in range(N):
		a, b = map(int, input().split())
		S.append([a, b])
	sorted_shop_list = sorted(S, key=lambda x: x[0])
	cost = 0
	for i in sorted_shop_list:
		a = i[0]
		b = i[1]
		if b < M:
			M -= b
			cost += a * b
		else:
			cost += a * M
			break
	print(cost)
	return

if __name__ == '__main__':
	main()
ba, bb = (int(x) for x in input().split())
m = a if a > b else b
for i in range(m+2):
    a = abs(a-i)
    b = abs(b-i)
    if a == b:
        print(i)
        break:
if i == m+1:
    print('IMPOSSIBLE')

### FIXED CODE ###

a, b = (int(x) for x in input().split())
ans = int(a/2+b/2+0.5)
if abs(a-ans) == abs(b-ans):
    print(ans)
else:
    print("IMPOSSIBLE")
import math

A,B=map(int,input().split())

n=int(A*B/math.gcd(A,B))

print(n)


### FIXED CODE ###

A,B=map(int,input().split())
def gcd(A,B):
    while B!=0:
        A,B=B,A%B
    return A
print(int(A*B/gcd(A,B)))
n = int(input())
can = [[[0, 0]] * 101 for _ in range(101)]


def solve(n, can):
    for k in range(n):
        x, y, h = map(int, input().split())
        if k == 0:
            for i in range(101):
                for j in range(101):
                    can[i][j] = h + abs(x - i) + abs(y - j)
        else:
            for i in range(101):
                for j in range(101):
                    if can[i][j] is None:
                        continue
                    gg = h + abs(x - i) + abs(y - j)
                    gh = can[i][j]
                    if gg != gh:
                        can[i][j] = None
    for i in range(101):
        for j in range(101):
            if can[i][j] is None:
                continue
            return i, j, can[i][j]


print(*solve(n, can))


### FIXED CODE ###

def solve(n):
    can = [[[-1, float('inf')] for _ in range(101)] for _ in range(101)]
    for k in range(n):
        x, y, h = map(int, input().split())
        for i in range(101):
            for j in range(101):
                if can[i][j] is None:
                    continue
                hh = h + abs(x - i) + abs(y - j)
                hl = 1 if h == 0 else hh
                nl, nh = max(can[i][j][0], hl), min(can[i][j][1], hh)
                if nl > nh:
                    can[i][j] = None
                else:
                    can[i][j][0] = nl
                    can[i][j][1] = nh

    for i in range(101):
        for j in range(101):
            if can[i][j] is None:
                continue
            return i, j, can[i][j][0]


n = int(input())
print(*solve(n))
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A+1) :
    for j in range(B+1) :
        for k in range(C+1) :
            if X%(500*i + 100*j + 50*k) == 0 :
                count += 1

print(count)


### FIXED CODE ###


A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A+1) :
    for j in range(B+1) :
        for k in range(C+1) :
            if X == 500*i + 100*j + 50*k :
                count += 1

print(count)
x, y = input().split()
if int(x) > int(y):
    print('>')
elif int(x) < int(y):
    print('<')
else:
    print('=')


### FIXED CODE ###

x, y = input().split()
if ord(x) > ord(y):
    print('>')
elif ord(x) < ord(y):
    print('<')
else:
    print('=')
import math
n,m = map(int,input().split())
s = input()
t = input()

lcm = n*m // math.gcd(n,m)
i = lcm
cnt = 0
while True:
    ans = [''] * i
    ai = 0
    for si in range(0,n):

        ans[ai] = s[si]
        ai += lcm//n
    ai = 0
    flg = True
    for ti in range(m):
        if ans[ai] == '' or t[ti] == ans[ai]:
            ans[ai] = t[ti]
        else:
            flg = False
            break
        ai += lcm//m
    if flg :
        print(i)
        break
    i += lcm
    cnt += 1
    if cnt == 10000:
        print(-1)
        break


### FIXED CODE ###

import fractions
n,m = map(int,input().split())
s = input()
t = input()

lcm = n*m // fractions.gcd(n,m)
ans = -1
ss = lcm // m
ts = lcm // n
j = 0
flg = True
for i in range(0,n,ss):
    if s[i] == t[j] :
        j += ts
        continue
    else:
        flg = False
        break

if flg :
    ans = lcm
print(ans)
S = input()
if S//100 == 7:
    print(Yes)
elif (S % 100) // 10 == 7:
    print(Yes)
elif (S % 100) % 10 == 7:
    print(Yes)
else:
    print(No)


### FIXED CODE ###

S = int(input())
if S // 100 == 7:
    print('Yes')
elif (S % 100) // 10 == 7:
    print('Yes')
elif (S % 100) % 10 == 7:
    print('Yes')
else:
    print('No')
N,K=input().strip().split(" ")
N=int(N)
K=int(K)
checkbox=[False for i in range(N)]
for k in range(K):
  input()
  seq=input().strip().split(" ")
  for j in seq:
    checkbox[i]=True
print(checkbox.count(False))

### FIXED CODE ###

N, K = input().strip().split(" ")
N = int(N)
K = int(K)
checkbox = [False for i in range(N)]
for k in range(K):
    input()
    seq = input().strip().split(" ")
    for j in seq:
        checkbox[int(j)-1] = True
print(checkbox.count(False))
class Stack:
    MAX = 101

    def __init__(self):
        self.S = [None] * self.__class__.MAX
        self.top = 0

    def is_empty(self):
        return self.top == 0

    def is_full(self):
        return self.top >= self.__class__.MAX - 1

    def push(self, x):
        self.top += 1
        self.S[self.top] = x

    def pop(self):
        self.top -= 1
        return self.S[self.top + 1]


stack = Stack()
[stack.push(eval("".join(map(str, [stack.pop(), s, stack.pop()][::-1]))))
 if s in["+", "-", "*"]else stack.push(int(s)) for s in str(s) for s in input().split()]
print(stack.pop())



### FIXED CODE ###

class Stack:
    MAX = 101

    def __init__(self):
        self.S = [None] * self.__class__.MAX
        self.top = 0

    def is_empty(self):
        return self.top == 0

    def is_full(self):
        return self.top >= self.__class__.MAX - 1

    def push(self, x):
        self.top += 1
        self.S[self.top] = x
        return x

    def pop(self):
        self.top -= 1
        return self.S[self.top + 1]


stack = Stack()
print([stack.push(eval("".join(map(str,[stack.pop(),s,stack.pop()][::-1]))))
       if s in["+","-","*"]else stack.push(int(s))for s in input().split()][-1])
n=int(input())
x=[0]
h=list(map(int,input().split()))
h=x+h

def cost(place):
    if place==n:
        return 0
    elif place==n-1:
        return abs(h[n-1]-h[n])
    else:
        a=abs(h[place]-h[place+2])+cost(place+2)
        b=abs(h[place]-h[place+1])+cost(place+1)
        if a<b:
            return a
        else:
            return b
print(cost(1))


### FIXED CODE ###

import sys
sys.setrecursionlimit(20000000)
n=int(input())
h=list(map(int,input().split()))
memory={}
def cost(place):
    if place in memory:
        return memory[place]
    if place==n-1:
        return 0
    if place==n-2:
        return abs(h[n-2]-h[n-1])
    if place<=n-3:
        a=abs(h[place]-h[place+2])+cost(place+2)
        b=abs(h[place]-h[place+1])+cost(place+1)
        x=min(a,b)
        memory[place]=x
        return x
print(cost(0))
int a=input()
print(a+a**2+a**3)

### FIXED CODE ###

a = int(input())
print(a+a**2+a**3)
a,b,c=map(int,input().split())
print('NO' if x<a or x>a+b else 'YES')

### FIXED CODE ###

a,b,x=map(int,input().split())
print('NO' if x<a or x>a+b else 'YES')