
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 si in set(s):
    if si in t:
        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 si in set(s):
    if si in t:
        ans += 1 si set(s) set s if si in t:
        ans += 1 si in t si t ans += 1 ans 1 print(ans) print ans s = [int(i) for i in input().split()] [int(i) for i in input().split()] s q = int(input()) int(input()) q ans = 0 0 ans t = [int(i) for i in input().split()] [int(i) for i in input().split()] t ans += 1 1 ans n = int(input()) int(input()) n

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 si in set(s):
    if si in t:
        ans += 1

print(ans)

