#include <bits/stdc++.h>
const int N = 1005;
const double eps = 1e-5;
using namespace std;
struct data {
  int T1, X1, Y1, T2, X2, Y2;
  double vx, vy;
} d[N];
int n, ans;
inline double cross(pair<double, double> a, pair<double, double> b) {
  return a.first * b.second - a.second * b.first;
}
inline bool cmp(pair<double, double> a, pair<double, double> b) {
  if (fabs(cross(a, b)) < eps) {
    if (fabs(a.first - b.first) < eps) return a.second < b.second;
    return a.first < b.first;
  }
  return cross(a, b) < 0;
}
int check(int id) {
  int res = 0;
  vector<double> T;
  vector<pair<double, double> > q;
  double X = d[id].X1 - d[id].vx * d[id].T1, Y = d[id].Y1 - d[id].vy * d[id].T1;
  for (int i = 1; i <= n; ++i)
    if (i != id) {
      double x = d[i].X1 - d[i].vx * d[i].T1, y = d[i].Y1 - d[i].vy * d[i].T1;
      double dltx = X - x, dlty = Y - y, dltvx = d[id].vx - d[i].vx,
             dltvy = d[id].vy - d[i].vy;
      double t = fabs(dltvx) > eps   ? dltx / dltvx
                 : fabs(dltvy) > eps ? dlty / dltvy
                                     : 0;
      if (fabs(dltvx * t - dltx) < eps && fabs(dltvy * t - dlty) < eps)
        T.push_back(t), q.emplace_back(dltvx, dltvy);
    }
  if (T.empty()) return 0;
  sort(T.begin(), T.end());
  int d = 1;
  for (int i = 1; i < T.size(); ++i) {
    if (fabs(T[i] - T[i - 1]) < eps)
      ++d;
    else
      res = max(res, d), d = 1;
  }
  res = max(res, d);
  d = 1;
  sort(q.begin(), q.end(), cmp);
  for (int i = 1; i < q.size(); ++i) {
    if (fabs(cross(q[i], q[i - 1])) < eps) {
      if (fabs(q[i].first - q[i - 1].first) > eps ||
          fabs(q[i].second - q[i - 1].second) > eps)
        ++d;
    } else
      res = max(res, d), d = 1;
  }
  res = max(res, d);
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    scanf("%d%d%d%d%d%d", &d[i].T1, &d[i].X1, &d[i].Y1, &d[i].T2, &d[i].X2,
          &d[i].Y2),
        d[i].vx = 1. * (d[i].X2 - d[i].X1) / (d[i].T2 - d[i].T1),
        d[i].vy = 1. * (d[i].Y2 - d[i].Y1) / (d[i].T2 - d[i].T1);
  for (int i = 1; i <= n; ++i) ans = max(ans, check(i));
  printf("%d\n", ans + 1);
  return 0;
}
