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

count = 0
for i in T:
    if i in S:
        count += 1

print(count) 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 count = 0 count 0 for i in T:
    if i in S:
        count += 1 i T if i in S:
        count += 1 i in S i S count += 1 count 1 print(count) print count count = 0 0 count q = int(input()) int(input()) q n = int(input()) int(input()) n S = input().split() input().split() S T = input().split() input().split() T count += 1 1 count
n = int(input())
S = input().split()
q = int(input())
T = input().split()

count = 0
for i in T:
    if i in S:
        count += 1

print(count)