a = [13,19,9,5,12,8,7,4,21,2,6,11]
gets
a=gets.split.map(&:to_i)
gets
b=gets.split.map(&:to_i)
def linear(a,n)
  for i in 0..a.size-1
    return 1 if a[i] == n
  end
  return 0
end
ans = 0
for i in 0..b.size-1
  ans += linear(a, b[i])
end

puts ans