Buggy python submission (verdict: Runtime Error):
import itertools

N = int(input())

evidence_dit = {}

for i in range(N):
    A = int(input())
    x_y = []
    for j in range(A):
        x_y.append(list(map(int,input().split())))
        
        evidence_dit[i] = x_y 

attribute = [0,1]
ans = 0

for i in itertools.product(attribute,repeat=N):
    flag = False
    
    for j in range(N):
        if i[j] == 1:
            for k in evidence_dit[j]:
                if i[k[0]-1] != k[1]:
                    flag = True
                    break
            if flag:
                break

    if flag == False:
        ans = max(ans,sum(i))
             

print(ans)
    

Fixed submission:
N = int(input())
xy = []
for i in range(N):
    A = int(input())
    xy.append([])
    for j in range(A):
        xy[i].append(tuple(map(int, input().split())))
 
ans = 0
 
for i in range(2 ** N):
    h = [0] * N
 
    for j in range(N):
        if (i >> j) & 1:
            h[j] = 1
    
    flag = False
    for i in range(N):
        if h[i] == 1:
            for x, y in xy[i]:
                if h[x-1] != y:
                    flag = True
                    break
            if flag:
                break
    
    if not flag:
        ans = max(ans, sum(h))
 
print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools

N = int(input())

evidence_dit = {}

for i in range(N):
    A = int(input())
    x_y = []
    for j in range(A):
        x_y.append(list(map(int,input().split())))
        
        evidence_dit[i] = x_y 

attribute = [0,1]
ans = []

for i in itertools.product(attribute,repeat=N):
    flag = False
    
    for j in range(N):
        if i[j] == 1:
            for k in evidence_dit[j]:
                if i[k[0]-1] != k[1]:
                    flag = True
                    break
            if flag:
                break

    if flag == False:
        ans.append(i.count(1))
             

print(max(ans))    
    

Fixed submission:
N = int(input())
xy = []
for i in range(N):
    A = int(input())
    xy.append([])
    for j in range(A):
        xy[i].append(tuple(map(int, input().split())))
 
ans = 0
 
for i in range(2 ** N):
    h = [0] * N
 
    for j in range(N):
        if (i >> j) & 1:
            h[j] = 1
    
    flag = False
    for i in range(N):
        if h[i] == 1:
            for x, y in xy[i]:
                if h[x-1] != y:
                    flag = True
                    break
            if flag:
                break
    
    if not flag:
        ans = max(ans, sum(h))
 
print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools

N = int(input())

evidence_dit = {}

for i in range(N):
    A = int(input())
    x_y = []
    for j in range(A):
        x_y.append(list(map(int,input().split())))
        
        evidence_dit[i+1] =  x_y

attribute = [0,1]
ans = []

for i in itertools.product(attribute,repeat=N):
    for j in range(N):
        if i[j] == 1:
            for k in evidence_dit[j+1]:
                if i[k[0]-1] != k[1]:
                    break
            else:
        
                continue
            break
    else:
        ans.append(i.count(1))
                

print(max(ans))    
    

Fixed submission:
N = int(input())
xy = []
for i in range(N):
    A = int(input())
    xy.append([])
    for j in range(A):
        xy[i].append(tuple(map(int, input().split())))
 
ans = 0
 
for i in range(2 ** N):
    h = [0] * N
 
    for j in range(N):
        if (i >> j) & 1:
            h[j] = 1
    
    flag = False
    for i in range(N):
        if h[i] == 1:
            for x, y in xy[i]:
                if h[x-1] != y:
                    flag = True
                    break
            if flag:
                break
    
    if not flag:
        ans = max(ans, sum(h))
 
print(ans)