while gets
	a = $_.chomp.split.map { |i| i.to_i }
	b = gets.chomp.split.map { |i| i.to_i }
	hit = 0
	for i in 0..a.size-1
		if a[i] == b[i]
			hit += 1 
		end
	end
	blow = (a&b).size - hit
	print hit
	print ' '
	print blow
	puts ''
end