import java.awt.*; import java.awt.geom.*; import java.io.*; import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[n]; int[] b = new int[n]; int[] c = new int[n]; int[] d = new int[n]; for(int i = 0; i < n; i++) { a[i] = sc.nextInt(); b[i] = sc.nextInt(); c[i] = sc.nextInt(); d[i] = sc.nextInt(); } int max = 0; for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { int ax = a[i]; int bx = b[i]; int cx = c[j]; int dx = d[j]; Line2D xL = new Line2D.Double(ax,bx,cx,dx); int ay = a[j]; int by = b[j]; int cy = c[i]; int dy = d[i]; Line2D yL = new Line2D.Double(ay,by,cy,dy); int xSum = 0; int ySum = 0; for(int k = 0; k < n; k++) { Line2D target = new Line2D.Double(a[k],b[k],c[k],d[k]); if(target.intersectsLine(xL)) xSum++; if(target.intersectsLine(yL)) ySum++; } max = Math.max(xSum, max); max = Math.max(ySum, max); } } System.out.println(max); } }