# coding: utf-8
# input
n = int(input())
s = list(map(int,input().split()))
q = int(input())
t = list(map(int,input().split()))
cnt = 0
for i in t:
    if i in s:
        cnt += 1
print(cnt) 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 cnt = 0 cnt 0 for i in t:
    if i in s:
        cnt += 1 i t if i in s:
        cnt += 1 i in s i s cnt += 1 cnt 1 print(cnt) print cnt t = list(map(int,input().split())) list(map(int,input().split())) t s = list(map(int,input().split())) list(map(int,input().split())) s n = int(input()) int(input()) n q = int(input()) int(input()) q cnt = 0 0 cnt cnt += 1 1 cnt
# coding: utf-8
# input
n = int(input())
s = list(map(int,input().split()))
q = int(input())
t = list(map(int,input().split()))
cnt = 0
for i in t:
    if i in s:
        cnt += 1
print(cnt)