abs = []

while line = $stdin.gets.chomp
  break if line == ""
  a = line.split(" ")
  b = $stdin.gets.chomp.split(" ")
  abs.push({:a => a, :b => b})
end

abs.each{|ab|
  hit = 0
  blow = 0
  ab[:a].each_with_index{|an, i|
    hit  += 1 if ab[:b][i] == an
    blow += 1 if ab[:b].count(an) > 0
  }
  puts "#{hit} #{blow}"
}