#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
const double eps = 1e-6;
const double PI = acos(-1);
struct Vector {
  double x, y;
  Vector() {}
  Vector(double _x, double _y) { x = _x, y = _y; };
};
Vector operator+(Vector a, Vector b) { return Vector(a.x + b.x, a.y + b.y); }
Vector operator-(Vector a, Vector b) { return Vector(a.x - b.x, a.y - b.y); }
Vector operator*(Vector a, double b) { return Vector(a.x * b, a.y * b); }
bool Equal(double a, double b) { return fabs(a - b) < eps; }
bool operator==(Vector a, Vector b) {
  return Equal(a.x, b.x) && Equal(a.y, b.y);
}
double Angle(Vector a) { return atan2(a.y, a.x); }
int n;
Vector p[N], v[N];
bool flag[N][N];
double t[N][N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int t1, t2;
    Vector p1, p2;
    scanf("%d %lf %lf %d %lf %lf", &t1, &p1.x, &p1.y, &t2, &p2.x, &p2.y);
    v[i] = (p2 - p1) * (1. / (t2 - t1));
    p[i] = p1 - v[i] * t1;
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (i != j) {
        double &T = t[i][j];
        if (v[i].x - v[j].x) T = -(p[i].x - p[j].x) / (v[i].x - v[j].x);
        if (v[i].y - v[j].y) T = -(p[i].y - p[j].y) / (v[i].y - v[j].y);
        if (p[i] + v[i] * T == p[j] + v[j] * T) flag[i][j] = 1;
      }
  int ans = 1;
  for (int i = 1; i <= n; ++i) {
    vector<double> lst;
    for (int j = 1; j <= n; ++j)
      if (i != j && flag[i][j]) lst.push_back(t[i][j]);
    sort(lst.begin(), lst.end());
    for (vector<double>::iterator i = lst.begin(); i != lst.end();) {
      vector<double>::iterator j = i;
      for (; j != lst.end() && Equal(*j, *i); ++j)
        ;
      ans = max(ans, int(j - i + 1));
      i = j;
    }
  }
  for (int i = 1; i <= n; ++i) {
    vector<pair<double, double> > lst;
    for (int j = 1; j <= n; ++j)
      if (i != j && flag[i][j]) {
        Vector u = v[j] - v[i];
        double ang = Angle(u);
        while (4. - eps > ang) ang += PI;
        lst.push_back(make_pair(ang, u.x * cos(ang) + u.y * sin(ang)));
      }
    sort(lst.begin(), lst.end());
    for (vector<pair<double, double> >::iterator i = lst.begin();
         i != lst.end();) {
      vector<pair<double, double> >::iterator j = i;
      vector<double> filter;
      for (; j != lst.end() && Equal(j->first, i->first); ++j)
        filter.push_back(j->second);
      i = j;
      sort(filter.begin(), filter.end());
      int cnt = 0;
      for (vector<double>::iterator k = filter.begin(); k != filter.end();) {
        vector<double>::iterator l = k;
        for (; l != filter.end() && Equal(*l, *k); ++l)
          ;
        ++cnt;
        k = l;
      }
      ans = max(ans, cnt + 1);
    }
  }
  printf("%d\n", ans);
  return 0;
}
