n = gets.to_i
taro = 0
hanako = 0
n.times do |i|
    a,b = gets.split
    if a == b then
        taro += 1
        hanako += 1
    elsif a <= b then
        hanako += 3
    else
        taro += 3
    end
end
puts "#{taro} #{hanako}"
