n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))

print(sum(1 for i in t if i in s))
 n = int(input()) n int(input()) int input() input s = list(map(int, input().split())) s list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split q = int(input()) q int(input()) int input() input t = list(map(int, input().split())) t list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split print(sum(1 for i in t if i in s)) print sum(1 for i in t if i in s) sum 1 s = list(map(int, input().split())) list(map(int, input().split())) s q = int(input()) int(input()) q t = list(map(int, input().split())) list(map(int, input().split())) t n = int(input()) int(input()) n
n = int(input())
s = list(map(int, input().split()))
q = int(input())
t = list(map(int, input().split()))

print(sum(1 for i in t if i in s))

