#include <bits/stdc++.h>
const double eps = 1e-7;
using namespace std;
struct dian {
  double x, y, vx, vy;
} a[2005];
struct xxx {
  double x, y, t;
} b[2005];
bool ttt(double a, double b) { return abs(a - b) < eps; }
bool operator<(const xxx& a, const xxx& b) {
  if (ttt(a.t, b.t)) return ttt(a.x, b.x) ? a.y < b.y : a.x < b.x;
  return a.t < b.t;
};
double det(xxx a, xxx b) { return a.x * b.y - a.y * b.x; }
double tim[2005];
int n, ans, tot;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int ax, ay, bx, by, at, bt;
    scanf("%d%d%d%d%d%d", &at, &ax, &ay, &bt, &bx, &by);
    a[i].vx = 1.0 * (bx - ax) / (bt - at);
    a[i].vy = 1.0 * (by - ay) / (bt - at);
    a[i].x = ax - 1.0 * a[i].vx * at;
    a[i].y = ay - 1.0 * a[i].vy * at;
  }
  for (int i = 1; i <= n; i++) {
    tot = 0;
    for (int j = 1; j <= n; j++)
      if (i != j) {
        dian q = (dian){a[j].x - a[i].x, a[j].y - a[i].y, a[j].vx - a[i].vx,
                        a[j].vy - a[i].vy};
        double t = ttt(q.vx, 0) ? q.y / q.vy : q.x / q.vx;
        if (ttt(q.x, q.vx * t) && ttt(q.y, q.vy * t))
          tim[++tot] = t, b[tot] = (xxx){q.vx, q.vy, atan2(q.vy, q.vx)};
      }
    sort(tim + 1, tim + tot + 1);
    for (int j = 1; j <= tot;) {
      int k = j + 1;
      while (k <= tot && abs(tim[k] - tim[k - 1]) < eps) k++;
      ans = max(ans, k - j);
      j = k;
    }
    sort(b + 1, b + tot + 1);
    for (int j = 1; j <= tot;) {
      int k = j + 1, p = (ttt(b[k].x, b[k - 1].x) && ttt(b[k].y, b[k - 1].y));
      while (k <= tot && ttt(det(b[k], b[k - 1]), 0))
        k++, p +=
             (k <= tot && ttt(b[k].x, b[k - 1].x) && ttt(b[k].y, b[k - 1].y));
      ans = max(ans, k - j - p);
      j = k;
    }
  }
  printf("%d", ans + 1);
}
