pointTarou = 0;
pointHanako = 0;
 
count = gets.to_i;
 
for index in 0..count-1 do
 
	aryCards = gets.split(' ');
 
	cardTarou = aryCards[0];
	cardHanako = aryCards[1];
 
	if cardTarou == cardHanako then
 
		pointTarou = pointTarou + 1;
		pointHanako = pointHanako + 1;
 
	elsif cardTarou > cardHanako then
 
		pointTarou = pointTarou +3;
 
	elsif cardTarou < cardHanako then
 
		pointHanako = pointHanako + 3;
 
	end
 
end
 
puts pointTarou.to_s + " " + pointHanako.to_s;