#!/usr/local/bin/ruby
while true
a=gets.split(" ").map(&:to_i)
b=gets.split(" ").map(&:to_i)
g,h=0,0
   for i in 0..3
      for j in 0..3
         if b[i]==a[j]
            if i == j
               h = h+1
            else
               g =g +1
            end
         end
      end
   end
   puts "#{h} #{g}"
end