hit = blow = 0

while a = gets
    a = a.split(" ").map{|i| i.to_i}
    b = gets.split(" ").map{|i| i.to_i}

    4.times do |i|
      if (a[i] == b[i]) then
        hit += 1
      else
        4.times do |j|
          if (a[i] == b[j])
            blow += 1
          end
        end
      end
    end

    puts "#{hit} #{blow}"

end