#include <bits/stdc++.h>
using namespace std;
using DO = long double;
const DO eps = 1e-7;
struct point {
  DO x, y;
  point(DO x = 0, DO y = 0) : x(x), y(y) {}
  point operator+(const point& a) { return {x + a.x, y + a.y}; }
  point operator-(const point& a) { return {x - a.x, y - a.y}; }
  point operator*(const DO& a) { return {x * a, y * a}; }
  point operator/(const DO& a) { return {x / a, y / a}; }
  DO operator^(const point& a) { return x * a.y - y * a.x; }
  DO operator*(const point& a) { return x * a.x + y * a.y; }
  bool operator<(const point& a) const {
    if (fabsl(x - a.x) < eps) return y + eps < a.y;
    return x + eps < a.x;
  }
  bool operator==(const point& a) const {
    return fabsl(x - a.x) < eps && fabsl(y - a.y) < eps;
  }
  DO nor() { return sqrtl(x * x + y * y); }
  DO al() { return atan2l(y, x); }
  void in() { cin >> x >> y; };
  void pr() { cout << x << ' ' << y << endl; };
};
const int NN = 1e3 + 10;
point p[NN], v[NN], D[NN];
DO f[NN];
int m;
void upgrade(point a, point b, point c, point d) {
  DO t;
  point e = a - c, g = d - b;
  if (fabsl(g.x) > eps)
    t = e.x / g.x;
  else
    t = e.y / g.y;
  e = a + b * t, g = c + d * t;
  if (e == g) {
    f[m] = t;
    D[m++] = {(d - b).al(), (d - b).nor()};
  }
}
int main() {
  int n, ans = 1;
  cin >> n;
  DO t1, t2;
  for (int i = 0; i < n; i++) {
    cin >> t1;
    p[i].in();
    cin >> t2;
    v[i].in();
    v[i] = (v[i] - p[i]) / (t2 - t1);
    p[i] = p[i] - v[i] * t1;
  }
  for (int I = 0; I < n; I++) {
    for (int J = m = 0; J < n; J++)
      if (I != J) upgrade(p[I], v[I], p[J], v[J]);
    sort(f, f + m);
    sort(D, D + m);
    for (int i = 0, j; i < m; i = j) {
      for (j = i; j < m && f[j] - f[i] < eps; j++)
        ;
      ans = max(ans, j - i + 1);
    }
    for (int i = 0, j, k; i < m; i = j) {
      for (j = i + 1, k = 0; j < m && fabsl(D[i].x - D[j].x) < eps; j++)
        k += (fabsl(D[j - 1].y - D[j].y) > eps);
      ans = max(ans, k + 2);
    }
  }
  cout << ans << endl;
  return 0;
}
