import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines class Point: def __init__(self, x, y): self.x=x self.y=y def __add__(self, other): return Point(self.x+other.x, self.y+other.y) def __sub__(self, other): return Point(self.x-other.x, self.y-other.y) def __mul__(self, other): return Point(self.x*other, self.y*other) def dot(self, other): return self.x*other.x+self.y*other.y def det(self, other): return self.x*other.y-self.y*other.x def __eq__(self, other): return self.x==other.x and self.y==other.y def is_intersect(p, q, r, s): a=(p-q).det(r-s) b=(p-r).det(r-s) if a==0: if b==0: return True else: return False if a>0: if 0<=b and b<=a: return True else: return False else: if 0>=b and b>=a: return True else: return False n=int(readline()) abcd=list(map(int, read().split())) ps=[Point(a, b) for a, b, c, d in zip(*[iter(abcd)]*4)] qs=[Point(c, d) for a, b, c, d in zip(*[iter(abcd)]*4)] pq=ps+qs ans=0 for i, r in enumerate(pq): for s in pq[:i]: if r==s: continue cnt=sum(is_intersect(p, q, r, s) for p, q in zip(ps, qs)) if ans