class HitBlow
  def check(a, b)
    hits = [a, b].transpose.select { |x, y| x == y }.flatten.uniq
    blows = a & b - hits
    [hits.size, blows.size]
  end
end

inputs = STDIN.read.split("\n")

inputs.each_slice(2) do |a, b|
  result = HitBlow.new.check(a.split.map(&:to_i), b.split.map(&:to_i))
  printf "%s %s\n", result[0], result[1]
end