N = 4

def hit(arr1, arr2)
  n = 0
  
  N.times do |i|
    n += 1 if arr1[i] == arr2[i]
  end
  
  return n
end

def blow(arr1, arr2)
  n = 0
  
  N.times do |i|
    N.times do |j|
      n += 1 if i != j && arr1[i] == arr2[j] 
    end
  end
  
  return n
end

while line1 = gets
  arr1 = line1.split
  arr2 = gets.split
  puts "#{hit(arr1, arr2)} #{blow(arr1, arr2)}"
end