#!python3
import fractions
class pt:
   def __init__(self, x=0, y=0):
      self.x = x
      self.y = y
class lin:
   def __init__(self, a=0, b=0):
      self.a = a
      self.b = b
def det(a,b):
   return (a.a.x-a.b.x)*(b.a.y-b.b.y)-(a.a.y-a.b.y)*(b.a.x-b.b.x)
def lineline(a,b):
   d = det(a,b)
   x = fractions.Fraction((a.a.x*a.b.y-a.a.y*a.b.x)*(b.a.x-b.b.x)-
                          (a.a.x-a.b.x)*(b.a.x*b.b.y-b.a.y*b.b.x),d)
   y = fractions.Fraction((a.a.x*a.b.y-a.a.y*a.b.x)*(b.a.y-b.b.y)-
                          (a.a.y-a.b.y)*(b.a.x*b.b.y-b.a.y*b.b.x),d)
   return pt(x,y)
def inbounds(p, a):
   return (p.x >= min(a.a.x, a.b.x) and p.x <= max(a.a.x, a.b.x) and
           p.y >= min(a.a.y, a.b.y) and p.y <= max(a.a.y, a.b.y))
def segseg(a, b):
   if det(a,b) == 0:
      return False
   p = lineline(a,b)
   return inbounds(p, a) and inbounds(p, b)
poly = []
v = []
n = 0
def recur(lastlin, used, togo):
   if togo == 0:
      j = 1
      while j+2<len(poly):
         if segseg(lin(poly[len(poly)-1], poly[0]), lin(poly[j], poly[j+1])):
            return 0
         j += 1
      return 1
   r = 0
   for i in range(n):
      if (togo == 1 and i == 0) or (togo != 1 and (((used >> i) & 1) == 0)):
         if det(v[lastlin], v[i]) == 0:
            continue
         p = lineline(v[lastlin], v[i])
         if len(poly) > 0 and p.x == poly[len(poly)-1].x and p.y == poly[len(poly)-1].y:
            continue
         good = True
         j = 0
         while good and j+2<len(poly):
            if segseg(lin(poly[j], poly[j+1]), lin(poly[len(poly)-1], p)):
               good = False
            j += 1
         if good:
            poly.append(p)
            r += recur(i, used | (1 << i), togo-1)
            poly.pop()
   return r
n = int(input())
for i in range(n):
   f = list(map(int,input().split()))
   v.append(lin(pt(f[0], f[1]), pt(f[2], f[3])))
r = recur(0, 1, n) // 2
print(r)
