Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
for i in range(K):
  D = list(int(input()))
  A = list(map(int, input().split()))
print(N - len(set(A)))

Fixed submission:
def resolve():
    N, K = map(int, input().split())
    A = []
    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A.extend(a)
    print(N - len(set(A)))
resolve()

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
for i in range(K):
  D = list(int(input()))
  A = list(map(int, input().split()))
list = set(A)
print(len(A) - len(list))

Fixed submission:
def resolve():
    N, K = map(int, input().split())
    A = []
    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A.extend(a)
    print(N - len(set(A)))
resolve()

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
c = 0
n = 1
for i in range(K):
  List = list(map(int, input().split()))
for I in range(N):
  if n in List:
  else:
    c = c+1
  n = n+1
print(c)

Fixed submission:
def resolve():
    N, K = map(int, input().split())
    A = []
    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A.extend(a)
    print(N - len(set(A)))
resolve()

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
c = 0
n = 1
for i in range(K):
  Lists = list(int(input()))
  List = list(map(int, input().split()))
for I in range(N):
  if n in List:
    n = n+1
  else:
    c = c+1
    n = n+1
print(c)

Fixed submission:
def resolve():
    N, K = map(int, input().split())
    A = []
    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A.extend(a)
    print(N - len(set(A)))
resolve()

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
c = 0
n = 1
List = []
for i in range(1,K):
  d = int(input())
  m = int(input())
  List.append(m)
for I in range(1,N):
  if n in List:
    n = n+1
  else:
    c = c+1
    n = n+1
print(c)

Fixed submission:
def resolve():
    N, K = map(int, input().split())
    A = []
    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A.extend(a)
    print(N - len(set(A)))
resolve()

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
c = 0
n = 1
w = 1
z = 1
while w<=K
  d = int(input())
  List = list(map(int, input().split()))
  w = w+1
while w<=N
  if n in List:
    n = n+1
    z = z+1
  else:
    c = c+1
    n = n+1
    z = z+1
print(c)

Fixed submission:
def resolve():
    N, K = map(int, input().split())
    A = []
    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A.extend(a)
    print(N - len(set(A)))
resolve()

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
c = 0
n = 0
for i in range(K):
  d = int(input())
  List = list(map(int, input().split()))
for I in range(N):
  n = n+1
  if n in List:
  else:
    c = c+1
print(c)

Fixed submission:
def resolve():
    N, K = map(int, input().split())
    A = []
    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A.extend(a)
    print(N - len(set(A)))
resolve()