n = gets.chomp.to_i
tarou_s = 0
hanako_s = 0
n.times{
  str1,str2 = gets.chomp.split
  if str1 < str2
    hanako_s += 3
  elsif str1 > str2
    tarou_s += 3
  else
    tarou_s += 1
    hanako_s += 1
  end
}

puts tarou_s.to_s + " " + hanako_s.to_s

