n = int(input())
s = [int(x) for x in input().split()]
q = int(input())
t = [int(x) for x in input().split()]
ans = 0

for x in t:
    c = s.count(x)
    if c != 0:
        ans += 1

print(ans) n = int(input()) n int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x s = [int(x) for x in input().split()] s [int(x) for x in input().split()] q = int(input()) q int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x t = [int(x) for x in input().split()] t [int(x) for x in input().split()] ans = 0 ans 0 for x in t:
    c = s.count(x)
    if c != 0:
        ans += 1 x t c = s.count(x) c s.count(x) s.count s count x if c != 0:
        ans += 1 c != 0 c 0 ans += 1 ans 1 print(ans) print ans n = int(input()) int(input()) n q = int(input()) int(input()) q ans += 1 1 ans c = s.count(x) s.count(x) c s = [int(x) for x in input().split()] [int(x) for x in input().split()] s t = [int(x) for x in input().split()] [int(x) for x in input().split()] t ans = 0 0 ans
n = int(input())
s = [int(x) for x in input().split()]
q = int(input())
t = [int(x) for x in input().split()]
ans = 0

for x in t:
    c = s.count(x)
    if c != 0:
        ans += 1

print(ans)