def aux(ss)
  p0=0
  p1=0
  while ss.length > 0
    s = ss.shift
    p = (s[0] <=> s[1])
    if p >0
      p0 += 3
    elsif p <0
      p1 += 3
    else
      p0 += 1
      p1 += 1
    end
  end

  [p0,p1]

end

def main
  fh=STDIN
  #fh=File.new("x.txt", "r")
  n = fh.gets.chomp.to_i
  l = []
  n.times {
    f = fh.gets.chomp.split
    l << f
  }
  #puts "l: #{l}"

  puts aux(l).map(&:to_s).join(' ')
end



if $0 == __FILE__ then
  main
end
