#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void mine(T1 &x, T2 y) {
  if (x > y) x = y;
}
template <typename T1, typename T2>
inline void maxe(T1 &x, T2 y) {
  if (x < y) x = y;
}
ostream &operator<<(ostream &a, const vector<long long> &b) {
  for (auto k : b) cout << k << ' ';
  return a;
}
const long long MOD = 1000000007;
const long long INF = 1000000050;
const long long BIG = (long long)2e18 + 50;
const long long MX = 2001;
const long double EPS = 1e-6;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
bool lt(long double x, long double y) { return x + EPS < y; }
bool eq(long double x, long double y) { return abs(x - y) < EPS; }
struct pt {
  long double x;
  long double y;
  long double z;
  pt(long double a, long double b, long double c) {
    x = a;
    y = b;
    z = c;
  }
  bool operator<(const pt &p) const {
    return lt(x, p.x) ||
           (eq(x, p.x) && (lt(y, p.y) || (eq(y, p.y) && lt(z, p.z))));
  }
  bool operator==(const pt &p) const {
    return eq(x, p.x) && eq(y, p.y) && eq(z, p.z);
  }
};
long double vx[MX], vy[MX], x[MX], y[MX];
bool can[MX][MX];
long double tt[MX][MX];
bool cmp(pair<long double, long double> a, pair<long double, long double> b) {
  return a.second < b.second;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long double t1, x1, y1, t2, x2, y2;
    cin >> t1 >> x1 >> y1 >> t2 >> x2 >> y2;
    vy[i] = (y2 - y1) / (t2 - t1);
    vx[i] = (x2 - x1) / (t2 - t1);
    x[i] = x1 - vx[i] * t1;
    y[i] = y1 - vy[i] * t1;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = i + 1; j < n; j++) {
      long double tim = 0;
      if (!eq(vx[i], vx[j])) tim = (x[i] - x[j]) / (vx[j] - vx[i]);
      if (!eq(vy[i], vy[j])) tim = (y[i] - y[j]) / (vy[j] - vy[i]);
      long double xx = x[i] + vx[i] * tim;
      long double yy = y[i] + vy[i] * tim;
      if (eq(xx, x[j] + vx[j] * tim) && eq(yy, y[j] + vy[j] * tim)) {
        can[i][j] = can[j][i] = true;
        tt[i][j] = tt[j][i] = tim;
      }
    }
  }
  long long ans = 1;
  for (long long i = 0; i < n; i++) {
    vector<pair<long double, long double>> kek;
    vector<long double> colis;
    for (long long j = 0; j < n; j++) {
      if (!can[i][j]) continue;
      colis.push_back(tt[i][j]);
      long double xx = vx[j] - vx[i];
      long double yy = vy[j] - vy[i];
      long double ang = atan2(yy, xx);
      if (ang < -EPS) ang += 4 * atan(1);
      kek.push_back({ang, sin(ang) * yy + cos(ang) * xx});
    }
    sort(colis.begin(), colis.end());
    long long it = 0;
    while (it < (long long)colis.size()) {
      long long it2 = it + 1;
      while (it2 < (long long)colis.size() && eq(colis[it2], colis[it])) ++it2;
      maxe(ans, it2 - it + 1);
      it = it2;
    }
    sort(kek.begin(), kek.end());
    long long her = 0;
    it = 0;
    while (it < (long long)kek.size()) {
      long long it2 = it + 1;
      while (it2 < (long long)kek.size() &&
             kek[it2].first - kek[it].first < EPS)
        ++it2;
      sort(kek.begin() + it, kek.begin() + it2, cmp);
      long long dif = 1;
      for (long long k = it + 1; k < it2; k++)
        dif += !eq(kek[k].second, kek[k - 1].second);
      maxe(her, dif + 1);
      it = it2;
    }
    maxe(ans, her);
  }
  cout << ans << '\n';
}
