while a=gets.split(" ").map(&:to_i)
	b=gets.split.map(&:to_i)
	c,d=0,0;
	#4.times do |i|
	#	if a[i]==b[i] then
	#		c+=1
	#	else
	#		4.times do |j|
	#			if a[i]==b[j] then
	#				d+=1;break;
	#			end
	#		end
	#	end
	#end
	print c," ",d,"\n"
end