n = int(input())
S = set(map(int, input().split()))
q = int(input())
T = set(map(int, input().split()))

count = 0
for x in T:
    count += 1 if x in S else 0

print(count) n = int(input()) n int(input()) int input() input S = set(map(int, input().split())) S set(map(int, input().split())) set map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input T = set(map(int, input().split())) T set(map(int, input().split())) set map(int, input().split()) map int input().split() ().split () input split count = 0 count 0 for x in T:
    count += 1 if x in S else 0 x T count += 1 if x in S else 0 count 1 if x in S else 0 x in S x S 1 0 print(count) print count n = int(input()) int(input()) n S = set(map(int, input().split())) set(map(int, input().split())) S q = int(input()) int(input()) q T = set(map(int, input().split())) set(map(int, input().split())) T count = 0 0 count count += 1 if x in S else 0 1 if x in S else 0 count
n = int(input())
S = set(map(int, input().split()))
q = int(input())
T = set(map(int, input().split()))

count = 0
for x in T:
    count += 1 if x in S else 0

print(count)