import sys sys.setrecursionlimit(10 ** 6) from bisect import * from collections import * from heapq import * int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def SI(): return sys.stdin.readline()[:-1] def MI(): return map(int, sys.stdin.readline().split()) def MI1(): return map(int1, sys.stdin.readline().split()) def MF(): return map(float, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LI1(): return list(map(int1, sys.stdin.readline().split())) def LF(): return list(map(float, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] dij = [(0, 1), (1, 0), (0, -1), (-1, 0)] def main(): def cross(x1,x2,y1,y2,k): vx,vy=x2-x1,y2-y1 x3,y3,x4,y4=lines[k] vx3,vy3=x3-x1,y3-y1 vx4,vy4=x4-x1,y4-y1 if (vx*vy3-vy*vx3)*(vx*vy4-vy*vx4)>0:return 0 else:return 1 n=II() if n==1: print(1) exit() lines=[LI() for _ in range(n)] ans=0 for i in range(n-1): l1=lines[i] for j in range(i+1,n): l2=lines[j] for p,q in [(0,0),(0,1),(1,0),(1,1)]: x1,y1=l1[p*2],l1[p*2+1] x2,y2=l2[q*2],l2[q*2+1] if (x1,y1)==(x2,y2):continue cur=sum(cross(x1,x2,y1,y2,k) for k in range(n)) if cur>ans:ans=cur print(ans) main()