n = int(input())
S = [int(x) for x in input().split()]
q = int(input())
T = [int(x) for x in input().split()]


res = 0

for num in T:
    if num in S:
        res += 1

print(res) 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()] res = 0 res 0 for num in T:
    if num in S:
        res += 1 num T if num in S:
        res += 1 num in S num S res += 1 res 1 print(res) print res T = [int(x) for x in input().split()] [int(x) for x in input().split()] T n = int(input()) int(input()) n q = int(input()) int(input()) q res = 0 0 res S = [int(x) for x in input().split()] [int(x) for x in input().split()] S res += 1 1 res
n = int(input())
S = [int(x) for x in input().split()]
q = int(input())
T = [int(x) for x in input().split()]


res = 0

for num in T:
    if num in S:
        res += 1

print(res)