#!/usr/bin/env ruby

turn = gets.to_i
line = []
taro_points = 0;hanako_points = 0
turn.times do 
    line = gets.split
    haro = line[0]
    hanako = line[1]
    if taro == hanako then
        taro_points += 1
        hanako_points += 1
    elsif haro > hanako then
        hanako_points += 3
    elsif taro < hanako then
        taro_points += 3
    end
end

puts "#{taro_points} #{hanako_points}"
