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

cnt = 0
for n in T:
    cnt += n in S

print(cnt) 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 = tuple(map(int, input().split())) T tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split cnt = 0 cnt 0 for n in T:
    cnt += n in S n T cnt += n in S cnt n in S n S print(cnt) print cnt S = set(map(int, input().split())) set(map(int, input().split())) S q = int(input()) int(input()) q cnt += n in S n in S cnt T = tuple(map(int, input().split())) tuple(map(int, input().split())) T cnt = 0 0 cnt n = int(input()) int(input()) n
n = int(input())
S = set(map(int, input().split()))
q = int(input())
T = tuple(map(int, input().split()))

cnt = 0
for n in T:
    cnt += n in S

print(cnt)