while s = gets
  na = s.split.map(&:to_i)
  nb = gets.split.map(&:to_i)

  h, b = 0, 0
  c = Array.new

  (0..na.size - 1).each { |i| 
    if na[i] == nb[i]
      h += 1
    else
      c.push(nb[i])
    end 
  }
  c.each { |x| b += 1 if na.include?(x) }

  puts "#{h} #{b}"
end