def hit_blow(arr1, arr2)
  n, m = 0, 0
  
  4.times do |i|
    n += 1 if arr1[i] == arr2[i]
    m += 1 if arr1.include?(arr2[i]) 
  end
  
  return [n, m - n]
end

while gets
  arr1, arr2 = $_.split, gets.split
  h, b = hit_blow(arr1, arr2)
  puts "#{h} #{b}"
end