n = gets.to_i
point = [0,0]
n.times do |i|
  s = gets.chomp.split(" ")
  if s[0] == s[1]
    point[0] += 1
    point[1] += 1
  elsif s[0] > s[1]
    point[0] += 3
  else
    point[1] += 3
  end
end
puts point.join(" ")