cri=gets.chomp.split(" ")

ans=gets.chomp.split(" ")

hit = 0
blow = 0

for x in 0..3
	if cri[x] == ans[x]
		hit += 1
	elsif cri.include?(ans[x]) && ans[x] != cri[x]
		blow += 1
	else
		next
	end
end

print hit," ",blow