n = int(input())
s = list(set(map(int, input().split())))
q = int(input())
t = list(map(int, input().split()))
cnt = 0

for i in range(len(s)):
    for j in range(q):
        if s[i] == t[j]:
            cnt += 1

print(cnt) n = int(input()) n int(input()) int input() input s = list(set(map(int, input().split()))) s list(set(map(int, input().split()))) list 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 = list(map(int, input().split())) t list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split cnt = 0 cnt 0 for i in range(len(s)):
    for j in range(q):
        if s[i] == t[j]:
            cnt += 1 i range(len(s)) range len(s) len s for j in range(q):
        if s[i] == t[j]:
            cnt += 1 j range(q) range q if s[i] == t[j]:
            cnt += 1 s[i] == t[j] s[i] s i t[j] t j cnt += 1 cnt 1 print(cnt) print cnt n = int(input()) int(input()) n q = int(input()) int(input()) q s = list(set(map(int, input().split()))) list(set(map(int, input().split()))) s cnt = 0 0 cnt cnt += 1 1 cnt t = list(map(int, input().split())) list(map(int, input().split())) t
n = int(input())
s = list(set(map(int, input().split())))
q = int(input())
t = list(map(int, input().split()))
cnt = 0

for i in range(len(s)):
    for j in range(q):
        if s[i] == t[j]:
            cnt += 1

print(cnt)