#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int n;
const double eps = 1e-6;
inline double dcmp(double x) {
  if (x < -eps) return -1;
  if (x > eps) return 1;
  return 0;
}
struct point {
  double x, y, ang;
  point() {}
  point(double _x, double _y) { x = _x, y = _y, ang = atan2(y, x); }
  friend bool operator<(point a, point b) {
    if (dcmp(a.ang - b.ang) == 0)
      return dcmp(a.x - b.x) ? a.x < b.x : a.y < b.y;
    return a.ang < b.ang;
  }
} v[maxn];
double t[maxn];
double dx[maxn], dy[maxn], ax[maxn], ay[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1, t1, x1, wangdyakuoi, t2, x2, y2; i <= n; i++) {
    scanf("%d%d%d%d%d%d", &t1, &x1, &wangdyakuoi, &t2, &x2, &y2);
    dx[i] = 1.0 * (x2 - x1) / (t2 - t1);
    dy[i] = 1.0 * (y2 - wangdyakuoi) / (t2 - t1);
    ax[i] = x1 - dx[i] * t1;
    ay[i] = wangdyakuoi - dy[i] * t1;
  }
  int ans = 1, tot = 0;
  for (int i = 1; i <= n; i++) {
    tot = 0;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      double vx = dx[i] - dx[j], vy = dy[i] - dy[j];
      double nx = ax[i] - ax[j], ny = ay[i] - ay[j];
      if (dcmp(vx) == 0 && dcmp(vy) == 0) continue;
      double nowt = dcmp(vx) ? nx / vx : ny / vy;
      if (dcmp(nx - vx * nowt) == 0 && dcmp(ny - vy * nowt) == 0) {
        t[++tot] = nowt;
        v[tot] = point(vx, vy);
      }
    }
    sort(t + 1, t + tot + 1);
    for (int j = 1, k = 0; j <= tot; j = k + 1) {
      while (k < tot && dcmp(t[k + 1] - t[j]) == 0) k++;
      ans = max(ans, k - j + 2);
    }
    sort(v + 1, v + tot + 1);
    for (int j = 1, k = 0; j <= tot; j = k + 1) {
      int res = 0;
      while (k < tot && dcmp(v[k + 1].ang - v[j].ang) == 0) {
        if (dcmp(v[k + 1].x - v[k].x) || dcmp(v[k + 1].y - v[k].y)) res++;
        k++;
      }
      ans = max(ans, res + 1);
    }
  }
  cout << ans << endl;
  return 0;
}
