#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld=long double;
const ld eps=1e-9;

struct apple {
	pair<int ,int>coors;
	pair<int ,int>v;
};

apple operator-(const apple&r, const apple&l) {
	apple ans;
	ans.coors.first=r.coors.first-l.coors.first;
	ans.coors.second=r.coors.second-l.coors.second;
	ans.v.first=r.v.first-l.v.first;
	ans.v.second=r.v.second-l.v.second;
	return ans;
}
vector<ld>quad_equa(ld a, ld b, ld c) {
	if (abs(a) < eps) {
		if (abs(b) < eps) {
			return vector<ld>();
		}
		else {
			return vector<ld>{-c / b};
		}
	}
	ld root = b*b - 4 * a*c;
	if (abs(root) < eps) {
		ld ans = -b / (2 * a);
		return vector<ld>(1, ans);
	}
	else if (root > 0) {
		ld ans = -b / (2 * a);
		vector<ld>anss(2);
		anss[0] = ans + sqrt(root) / (2 * a);
		anss[1] = ans - sqrt(root) / (2 * a);
		if (anss[0] > anss[1])swap(anss[0], anss[1]);
		return anss;
	}
	else {
		return vector<ld>();
	}
}
vector<pair<ld,ld>> solve(vector<apple>apples) {
	apple apple_1=apples[1]-apples[0];
	apple apple_2=apples[2]-apples[0];

	ld two=apple_1.v.first*apple_2.v.second-(apple_1.v.second*apple_2.v.first);

	ld one=apple_1.v.first* (apple_2.coors.second) + apple_2.v.second* (apple_1.coors.first)-
		apple_2.v.first*(apple_1.coors.second)-apple_1.v.second*(apple_2.coors.first);

	ld zero=(apple_1.coors.first)*(apple_2.coors.second)
		-(apple_1.coors.second)*(apple_2.coors.first);
	zero=zero;

	auto v=quad_equa(two,one,zero);

	vector<pair<ld,ld>>ans;
	for (auto a : v) {
		if (a > -eps) {
			ans.push_back(make_pair(a-eps,a+eps));
		}
	}
	if (abs(two) < eps&&abs(one) < eps&&abs(zero) < eps) {
		ans.emplace_back(-1e8,1e8);
	}
	return ans;

}
class Compress {
public:
	bool operator()(const ld&l, const ld&r)const {
		return l+eps<r;
	}
};
int main() {
	int N;cin>>N;
	vector<pair<apple,int>>apples;
	for (int i = 0; i < N; ++i) {
		int a,b,c,d;cin>>a>>b>>c>>d;

		apple n_apple{ make_pair(a,b),make_pair(c,d) };
		auto it = find_if(apples.begin(), apples.end(), [&](const pair<apple,int>&l) {
			return l.first.coors==n_apple.coors&&l.first.v==n_apple.v;
		});
		if (it == apples.end()) {
			apples.push_back(make_pair(apple{ make_pair(a,b),make_pair(c,d) },1));
		}
		else {
			it->second++;
		}

	}
	

	int ans=0;

	set<ld,Compress>aset;
	for (int i = 0; i < apples.size(); ++i) {
		for (int j = 0; j < apples.size(); ++j) {
			if(i==j)continue;

			auto apple_i=apples[i].first;
			auto apple_j=apples[j].first;
			ld time=-2;
			
				
				int dx=apple_i.coors.first-apple_j.coors.first;
				int dy=apple_i.coors.second-apple_j.coors.second;
				dx=-dx;
				dy=-dy;
				int dvx=apple_i.v.first-apple_j.v.first;
				int dvy=apple_i.v.second-apple_j.v.second;

				bool ok=true;

				ld time1=-1;
				if (dx >= 0 && dvx > 0) {
					time1=ld(dx)/dvx;
				}
				else if (dx == 0 && dvx == 0) {
					time1=1e9;
				}
				else if (dx <= 0 && dvx < 0) {
					time1=ld(dx)/dvx;
				}
				else {
					ok=false;
				}
				ld time2=-1;
				if (dy*dvy > 0) {
					time2=ld(dy)/dvy;
				}
				else if (dy == 0 && dvy == 0) {
					time2=1e9;
				}
				else if (dy == 0 && dvy != 0) {
					time2=0;
				}
				else {
					ok=false;
				}
				if (ok) {
					if(time1>1e8)time1=time2;
					if(time2>1e8)time2=time1;

					if(abs(time1-time2)<eps)time=time1;
				}
				aset.emplace(time);

			map < ld, int, Compress > mp;
			if (time > -eps) {
				mp[time-2*eps]-=1000;
				mp[time+2*eps]+=1000;
			}
			for (int k = 0; k < apples.size(); ++k) {
				if(i==k||j==k)continue;
				auto apple_k=apples[k].first;

				auto v = solve(vector<apple>{apple_i, apple_j, apple_k});

				for (auto p : v) {

					mp[p.first] += apples[k].second;
					mp[p.second] -= apples[k].second;
				}

			}
			mp[1]+=0;
			int sum=apples[i].second+apples[j].second;
			for (auto m : mp) {
				if (m.first > -eps) {
					ans=max(ans,sum);
				}
				sum+=m.second;
				if (m.first >= -eps) {
					ans = max(ans, sum);
					
				}
			}
		}
	}

	if (apples.size() <=2) {
		ans=N;
	}else if (aset.size() == 1 && *aset.begin() > -1) {
		ans=N;
	}
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 3164