N = gets.chomp.to_i
xy = []
N.times do |i|
  xy[i] = gets.chomp.split.map(&:to_i)
end

require 'pry'

# @return Boolen
def exist_innner?(a, b, c)
  abc = [a,b,c]
  x_max = abc.select{|v| v[0] == [a[0], b[0], c[0]].max}.first
  x_min = abc.select{|v| v[0] == [a[0], b[0], c[0]].min}.first
  abc.delete(x_max)
  abc.delete(x_min)
  middle = abc[0]
  (middle[1] <= [x_max[1], x_min[1]].max) && (middle[1] >= [x_max[1], x_min[1]].min)
end

pairs = xy.combination(3).select{|a, b, c| exist_innner?(a,b,c)}
cnt = pairs.count


def comb(n, i)
  raise "引数が範囲外です" if i < 0 || i > n
  return 1 if i == 0 || i == n
  k = i > (n / 2) ? (n - i) : i
  ((n-k+1)..n).inject(:*) / (1..k).inject(:*)
end



def calc(cnt)
  ans = 0
  N.times do |j|
    ans += (j + 1) * comb(N, j+1)
  end
  
  case N
  when 1
    return ans
  when 2
    return ans
  when 3
    return ans + cnt
  else
    b = 0
    (N-3+1).times do |j|
      b += comb(N-3, j)
    end
    
    return ans + (cnt*b)
  end
end

puts calc(cnt) % 998244353
