n = gets.to_i
s = gets.split.map(&:to_i)
q = gets.to_i
t = gets.split.map(&:to_i)

def binary_search(ary, left, right, value)
  mid = ((left+right)/2).floor

  if left > right
    return false
  end

  if ary[mid] == value
    return true
  end

  if ary[mid] > value
    binary_search(ary, left, mid-1, value)
  else
    binary_search(ary, mid+1, right, value)
  end

end

p (t.inject(0) do |cnt, u|
  cnt+=1 if binary_search(s, 0, s.length-1, u)
  cnt
end)

