def binarySearch(a,key)
  left = 0
  right= a.length
  while left < right
    mid = (left +right)/2
    if a[mid]==key
      return mid
    elsif key<a[mid]
      right =mid
    else
      left =mid+1
    end
  end
  return false
end
gets;ss=gets.split.map(&:to_i);gets;ts=gets.split.map(&:to_i)
count=0
ts.each{|t|count+=1 if binarySearch(ss,t)!=false}
puts  count

