def binarySearch(arr,key)
  left=0
  right=@n
  while left<right
    mid=(left+right)/2
    if arr[mid]==key
      return mid
    elsif key<arr[mid]
      right=mid
    else
      left=mid+1
    end
  end
  return FALSE
end
cnt=0
@n=gets.to_i
s=gets.split.map(&:to_i)
q=gets.to_i
t=gets.split.map(&:to_i)
t.each do |key|
  if binarySearch(s,key)
    cnt+=1
  end
end
puts cnt