#define _CRT_SECURE_NO_WARNINGS //#define _GLIBCXX_DEBUG #include using namespace std; typedef long long ll; //#define int ll //#define endl "\n" typedef vector vi; typedef vector vvi; typedef pair pii; #define all(c) (c).begin(), (c).end() #define loop(i,a,b) for(ll i=a; i ostream & operator<<(ostream & os, vector const &); template typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple const &){} template typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple const & t){ os << (n==0?"":" ") << get(t); _ot(os, t); } template ostream & operator<<(ostream & os, tuple const & t){ _ot<0>(os, t); return os; } template ostream & operator<<(ostream & os, pair const & p){ return os << "(" << p.first << ", " << p.second << ") "; } template ostream & operator<<(ostream & os, vector const & v){ rep(i,v.size()) os << v[i] << (i+1==(int)v.size()?"":" "); return os; } template inline bool chmax(T & x, T const & y){ return x inline bool chmin(T & x, T const & y){ return x>y ? x=y,true : false; } #ifdef DEBUG #define dump(...) (cerr<<#__VA_ARGS__<<" = "< Point; #define X real() #define Y imag() const Real EPS = 1e-10; const Real INF = 1e100; const Real PI = acos(-1); struct Segment { Point p[2]; Segment (Point a = Point(), Point b = Point()){ p[0] = a, p[1] = b; } Point & operator [] (int k) { return p[k]; } Point const & operator [] (int k) const { return p[k]; } }; struct Line { Point p[2]; Line (Point a = Point(), Point b = Point()){ p[0] = a, p[1] = b; } Point & operator [] (int k) { return p[k]; } Point const & operator [] (int k) const { return p[k]; } }; Real dot(Point a, Point b){ return a.X*b.X + a.Y*b.Y; } Real cross(Point a, Point b){ return a.X*b.Y - a.Y*b.X; } enum { LEFT = 1, RIGHT = -1, BACK = 2, FRONT = -2, ON = 0 }; int ccw(Point p, Point q, Point r){ Point a = q-p, b = r-p; if(cross(a,b) > EPS) return LEFT; if(cross(a,b) < -EPS) return RIGHT; if(dot(a,b) < -EPS) return BACK; if(norm(a) < norm(b)) return FRONT; return ON; } bool iLS(Line const & l, Segment const & s){ int a = ccw(l[0], l[1], s[0]); int b = ccw(l[0], l[1], s[1]); // neither LEFT-LEFT nor RIGHT-RIGHT return abs(a*b) != 1; } signed main(){ int n; cin >> n; vector ss(n); vector ps(n*2); int x,y; rep(i,n){ cin >> x >> y; ss[i][0] = Point(x,y); cin >> x >> y; ss[i][1] = Point(x,y); ps[i*2] = ss[i][0]; ps[i*2+1] = ss[i][1]; } int ans = 0; rep(i,ps.size())rep(j,i){ Line l(ps[i],ps[j]); int cnt = 0; rep(i,n) cnt += iLS(l,ss[i]); ans = max(ans, cnt); } cout << ans << endl; }