# Your code here!
while l = gets
    a = l.split.map(&:to_i)
    b = gets.split.map(&:to_i)

    hit = 0
    blaw = 0
    3.downto(0) do |i|
        if a[i] == b[i]
            a.slice!(i)
            b.slice!(i)
            hit += 1
        end
    end

    blaw = a.length - (a - b).length
    puts "#{hit} #{blaw}"
end

