#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; #define EPS 1e-8 class V2{ public: double x, y; V2(){} V2(double x_, double y_):x(x_),y(y_){} bool operator<(const V2 &p) const{ return x!=p.x?x1 || k2>1); } int N; vi A, B, C, D; const int R = 200; int main(){ cin >> N; A = B = C = D = vi(N); rep(i, N)cin >> A[i] >> B[i] >> C[i] >> D[i]; vector P; rep(i, N){ P.emplace_back(A[i], B[i]); P.emplace_back(C[i], D[i]); } sort(all(P)); P.erase(unique(all(P)), P.end()); int ans = min(2, N); rep(i, sz(P))FOR(j, i + 1, sz(P)){ int ax, ay, bx, by; tie(ax, ay) = P[i]; tie(bx, by) = P[j]; int dx = ax - bx, dy = ay - by; ax += dx * R; ay += dy * R; bx -= dx * R; by -= dy * R; V2 S(ax, ay), T(bx, by); int tmp = 0; rep(k, N){ tmp += colSegSeg(S, T, V2(A[k], B[k]), V2(C[k], D[k])); } smax(ans, tmp); } cout << ans << endl; }