points = {:taro => 0, :hanako => 0}
loop = gets.to_i

loop.times{
    taro, hanako = gets.chomp.split
    if taro > hanako
        points[:taro] += 3
    elsif taro < hanako
        points[:hanako] += 3
    else
        points[:taro] += 1
        points[:hanako] += 1
    end
}

puts "#{points[:taro]} #{points[:hanako]}"
