n = gets.to_i
t_point = 0
h_point = 0
n.times{
    t = gets.split.map(&:to_s)
    if t[0].to_s < t[1].to_s
        h_point += 3
    elsif t[0].to_s > t[1].to_s
        t_point += 3
    else
        t_point += 1
        h_point += 1
    end
}
puts "#{t_point} #{h_point}"
