t_score = 0
h_score = 0

gets.to_i.times{
    x = gets.split
    if x[0] == x[1] then
        t_score += 1
        h_score += 1
        
    elsif x[0] == x.sort[0] then
        h_score += 3
    else
        t_score += 3
    end
}
puts [t_score, h_score].join(" ")
