
n = gets.to_i
taro = 0
hanako = 0

for j in 1..n

s, t =  gets.split

if (s<t) == true then
hanako += 3
else
if (s>t) == true then
taro += 3
else
hanako += 1
taro += 1
end
end

end

puts "#{taro} #{hanako}"

