while line = STDIN.gets
  a = line.chomp.split(' ').map { |item| item.to_i }
  b = STDIN.gets.chomp.split(' ').map { |item| item.to_i }
  has_a={}
  a.each do |e| 
    has_a[e]=1
  end
  hit=0
  blow=0
  (0...4).each do |i| 
    if a[i] == b[i] then
      hit+=1
      next
    end
    if has_a.has_key?(b[i]) then
      blow+=1
    end  
  end
  puts "#{hit} #{blow}"
end