#include #include #include using namespace std; #define RREP(i,s,e) for (i = s; i >= e; i--) #define rrep(i,n) RREP(i,(int)(n)-1,0) #define REP(i,s,e) for (i = s; i <= e; i++) #define rep(i,n) REP(i,0,(int)(n)-1) #define INF 100000000 typedef long long ll; double det(pair p, pair q) { return p.first * q.second - p.second * q.first; } double dot(pair p, pair q) { return p.first * q.first + p.second * q.second; } pair operator+(pair p, pair q) { return make_pair(p.first+q.first,p.second+q.second); } pair operator-(pair p, pair q) { return make_pair(p.first-q.first,p.second-q.second); } pair operator*(double s, pair p) { p.first *= s; p.second *= s; return p; } int main() { int i, j, k, ib, jb, n, ans; pair cor[100][2]; cin >> n; ans = 0; rep (i,n) cin >> cor[i][0].first >> cor[i][0].second >> cor[i][1].first >> cor[i][1].second; rep (i,n) rep (j,n) rep (ib,2) rep (jb,2) if (cor[i][ib] != cor[j][jb]) { int cnt = 0; rep (k,n) if ((cor[k][0] != cor[i][ib] || cor[k][1] != cor[j][jb]) && (cor[k][0] != cor[j][jb] || cor[k][1] != cor[i][ib])) { double a = det(cor[k][0]-cor[k][1],cor[k][0]-cor[j][jb]); double b = det(cor[k][0]-cor[k][1],cor[i][ib]-cor[j][jb]); if (b == 0) { if (a == 0) cnt++; } else { auto p = cor[j][jb] + a/b * (cor[i][ib] - cor[j][jb]); if (dot(cor[i][ib]-p,cor[j][jb]-p) <= 0 && dot(cor[k][0]-p,cor[k][1]-p) <= 0) cnt++; } } ans = max(ans,cnt); } cout << ans << endl; return 0; }