while input=gets
	a=input.chomp.split(" ")
	b=gets.chomp.split(" ")
	hit=0
	blow=0
	4.times{|i|
		4.times{|j|
			if a[i]==b[j] then
				if i==j then
					hit+=1
				else
					blow+=1
				end
			end
		}
	}
	print(hit," ",blow,"\n")
end
