n = gets.to_i
s = gets.split.map(&:to_i)
q = gets.to_i
t = gets.split.map(&:to_i)
# puts (s & t).size
c = 0
for i in 0..q-1
  for j in 0..n-1
    if s[j] == t[i]
      c += 1
      next
    end
  end
end

p c