import java.util.Scanner; public class Main_yukicoder245 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[][] a = new int[4][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < 4; j++) { a[j][i] = sc.nextInt(); } } int max = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j ++) { int tmp = 0; int tmp1 = 0; int tmp2 = 0; int tmp3 = 0; for (int k = 0; k < n; k++) { if (Geom.lineIntersect(a[0][i], a[1][i], a[0][j], a[1][j], a[0][k], a[1][k], a[2][k], a[3][k])) { tmp++; } if (Geom.lineIntersect(a[0][i], a[1][i], a[2][j], a[3][j], a[0][k], a[1][k], a[2][k], a[3][k])) { tmp1++; } if (Geom.lineIntersect(a[1][i], a[2][i], a[0][j], a[1][j], a[0][k], a[1][k], a[2][k], a[3][k])) { tmp2++; } if (Geom.lineIntersect(a[1][i], a[2][i], a[2][j], a[3][j], a[0][k], a[1][k], a[2][k], a[3][k])) { tmp3++; } } max = Math.max(max, tmp); max = Math.max(max, tmp1); max = Math.max(max, tmp2); max = Math.max(max, tmp3); } } System.out.println(max); sc.close(); } @SuppressWarnings("unused") private static class Geom { static int dot(int xa, int ya, int xb, int yb) { return xa * xb + ya * yb; } static int cross(int xa, int ya, int xb, int yb) { return xa * yb - xb * ya; } static int sumofsquare(int xa, int ya) { return xa * xa + ya * ya; } static boolean lineIntersect(int xa, int ya, int xb, int yb, int xc, int yc, int xd, int yd) { int abx = xb - xa; int aby = yb - ya; int acx = xc - xa; int acy = yc - ya; int adx = xd - xa; int ady = yd - ya; int cdx = xd - xc; int cdy = yd - yc; int cax = xa - xc; int cay = ya - yc; int cbx = xb - xc; int cby = yb - yc; return ((long)cross(abx, aby, acx, acy) * cross(abx, aby, adx, ady) <= 0) && ((long)cross(cdx, cdy, cax, cay) * cross(cdx, cdy, cbx, cby) <= 0); } } }