#!/usr/bin/env ruby

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

puts "#{taro_points} #{hanako_points}"
