class SearchI
  def solve
    n = gets.chomp.to_i
    s = gets.scan(/\d+/).map(&:to_i)
    q = gets.chomp.to_i
    t = gets.scan(/\d+/).map(&:to_i)

    cnt = 0
    t.each do |x|
      if is_include(x, s)
        cnt += 1
      end
    end
    return cnt.to_s
  end

  def is_include(e, ls)
    ls.each do |x|
      if e == x
        return true
      end
    end
    return false
  end
end

if $0 == __FILE__
  puts SearchI.new.solve
end