while line = gets
  a = line.split.map(&:to_i)
  b = gets.split.map(&:to_i)
  ht,bw = 0,0
  4.times do |i|
    if a[i] == b[i] then ht += 1
    elsif a.include? b[i] then bw += 1 end
  end
  puts "#{ht} #{bw}"
end