n = gets.chomp.to_i
t_point = 0
h_point = 0
n.times do
    taro, hanako = gets.chomp.split
    if taro == hanako
        t_point += 1
        h_point += 1
    end
    if taro < hanako
        h_point += 3
    end
    if taro > hanako
        t_point += 3
    end
end
puts "#{t_point} #{h_point}"