lines = STDIN.read.split("\n")
n = lines.shift.to_i
score = Array.new(2, 0)
n.times.each do |i|
  s1, s2 = lines[i].split(" ")
  if s1 > s2
    score[0] += 3
  elsif s1 < s2
    score[1] += 3
  else
    score[0] += 1
    score[1] += 1
  end
end
puts score.join(" ")