n = int(input())
S = input().split()

q = int(input())
T = input().split()

cnt = 0

for i in range(q):
    if T[i] in S:
        cnt += 1

print(cnt) n = int(input()) n int(input()) int input() input S = input().split() S input().split() ().split () input split q = int(input()) q int(input()) int input() input T = input().split() T input().split() ().split () input split cnt = 0 cnt 0 for i in range(q):
    if T[i] in S:
        cnt += 1 i range(q) range q if T[i] in S:
        cnt += 1 T[i] in S T[i] T i S cnt += 1 cnt 1 print(cnt) print cnt n = int(input()) int(input()) n cnt = 0 0 cnt T = input().split() input().split() T S = input().split() input().split() S q = int(input()) int(input()) q cnt += 1 1 cnt
n = int(input())
S = input().split()

q = int(input())
T = input().split()

cnt = 0

for i in range(q):
    if T[i] in S:
        cnt += 1

print(cnt)