while input = gets do
  a = input.split.map(&:to_i)
  b = gets.split.map(&:to_i)
  hit = 0

  for i in 0..3
    hit += 1 if a[i] == b[i]
  end

  puts "#{hit} #{(a - b).length - hit < 0 ? 0 : (a - b).length - hit}"
end