def HitandBlow( listA, listB )
	num_hit  = 0
	num_blow = 0
	4.times{ |n|
		if listA[n-num_hit] == listB[n-num_hit]
			listA.delete_at( n - num_hit)
			listB.delete_at( n - num_hit)
			num_hit += 1
		end
	}
	listA.each{ |a|
		num_blow += 1 if listB.include?( a )
	}
	return [num_hit,num_blow]
end

def main
	answers = Array.new
	while line = $stdin.gets
		listA = line.chomp.split(/\s/).map{|n| n.to_i }
		line = $stdin.gets
		listB = line.chomp.split(/\s/).map{|n| n.to_i }
		answers << HitandBlow( listA, listB )
	end
	answers.each{ |a|
		printf( "%d %d\n",a[ 0 ],a[ 1 ] )
	}
end
main
