N = list(map(int, input().split()))
bamboo =[input().rstrip() for i in range(int(N[0]))]
N_sorted = sorted(N[1:])
MP = 0
for i in range(len(bamboo)):
    for j in range(len(N_sorted)):
        if int(bamboo[i]) == N_sorted[j]:
            del N_sorted[j]
if len(N_sorted) == 0:
    print(MP)