n = gets.to_i
tarou = 0
hanako = 0
n.times {
   tarou_hand,hanako_hand = gets.split(" ")
   if (tarou_hand <=> hanako_hand) == 1
      tarou += 3
   elsif (tarou_hand <=> hanako_hand) == -1
      hanako += 3
   else
      hanako += 1
      tarou += 1
   end
}
puts "#{tarou} #{hanako}"