#include "bits/stdc++.h" using namespace std; #define int long long #define FOR(i, a, b) for(int i=(a);i<(b);i++) #define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--) #define REP(i, n) for(int i=0; i<(n); i++) #define RREP(i, n) for(int i=(n-1); i>=0; i--) #define ALL(a) (a).begin(),(a).end() #define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end()); #define CONTAIN(a, b) find(ALL(a), (b)) != (a).end() #define array2(type, x, y) array, x> #define vector2(type) vector > #define out(...) printf(__VA_ARGS__) int dxy[] = {0, 1, 0, -1, 0}; /*================================*/ int N,M,L; struct Pos { int x, y; bool operator == (Pos q) { return (x == q.x) && (y == q.y); } }; signed main() { #if DEBUG std::ifstream in("input.txt"); std::cin.rdbuf(in.rdbuf()); #endif cin>>N; vector> L(N); REP(i,N) { cin >> L[i].first.x >> L[i].first.y >> L[i].second.x >> L[i].second.y; } int ans = 0; REP(i,2*N) REP(j,2*N){ auto p1 = (i%2) ? L[i/2].first : L[i/2].second; auto p2 = (j%2) ? L[j/2].first : L[j/2].second; if (p1 == p2) continue; int a = p1.x - p2.x; int b = p1.y - p2.y; /* tc=(x1-x2)*(y3-y1)+(y1-y2)*(x1-x3) td=(x1-x2)*(y4-y1)+(y1-y2)*(x1-x4) tc*td<=0 */ int cnt = 0; for (auto l : L) { auto p3 = l.first; auto p4 = l.second; int tc = a * (p3.y - p1.y) + b * (p1.x - p3.x); int td = a * (p4.y - p1.y) + b * (p1.x - p4.x); if (tc * td <= 0) cnt++; } ans = max(ans, cnt); } cout << ans << endl; return 0; }