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

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

print(ans)

