#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); } double distSegPt(const V2 &a, const V2 &b, const V2 &p){ V2 ab=b-a, ap=p-a, ba=a-b, bp=p-b; if(dot(ab, ap) < EPS) return ap.dist(); if(dot(ba, bp) < EPS) return bp.dist(); else return abs(cross(ab, ap) / ab.dist()); } double distSegSeg(const V2 &a, const V2 &b, const V2 &c, const V2 &d){ double res = numeric_limits::max(); if(colSegSeg(a, b, c, d)) res = 0.0; res = min(res, distSegPt(a, b, c)); res = min(res, distSegPt(a, b, d)); res = min(res, distSegPt(c, d, a)); res = min(res, distSegPt(c, d, b)); return res; } 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 += distSegSeg(S, T, V2(A[k], B[k]), V2(C[k], D[k])) < EPS; } smax(ans, tmp); } cout << ans << endl; }