#include <bits/stdc++.h>
using namespace std;
int n;
struct node {
  long double x0, y0;
  long double xv, yv;
  void print() { cout << x0 << " " << y0 << " " << xv << " " << yv << "\n"; }
} a[1111];
const long double eps1 = 1e-7, eps2 = 1e-7;
int sgn1(long double a) {
  if (-eps1 <= a && a <= eps1) return 0;
  return a > 0 ? 1 : -1;
}
int sgn2(long double a) {
  if (-eps2 <= a && a <= eps2) return 0;
  return a > 0 ? 1 : -1;
}
const long double pi = acos(-1);
map<pair<int, pair<int, int> >, int> mp;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int aa, b, c, d, e, f;
    cin >> aa >> b >> c >> d >> e >> f;
    a[i].xv = 1. * (e - b) / (d - aa);
    a[i].yv = 1. * (f - c) / (d - aa);
    a[i].x0 = b - aa * a[i].xv;
    a[i].y0 = c - aa * a[i].yv;
  }
  int ans = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i != j)
        a[j].xv -= a[i].xv, a[j].yv -= a[i].yv, a[j].x0 -= a[i].x0,
            a[j].y0 -= a[i].y0;
    }
    vector<long double> v;
    vector<pair<long double, pair<long double, long double> > > w;
    for (int j = 1; j <= n; j++) {
      if (i != j) {
        if (sgn2(a[j].xv) == 0 && sgn2(a[j].yv) == 0) continue;
        long double t = sgn2(a[j].xv) ? a[j].x0 / a[j].xv : a[j].y0 / a[j].yv;
        if (sgn2(a[j].x0 - t * a[j].xv) == 0 &&
            sgn2(a[j].y0 - t * a[j].yv) == 0) {
          v.push_back(t);
          long double t = atan2(a[j].yv, a[j].xv);
          auto p = make_pair(a[j].xv, a[j].yv);
          w.push_back(make_pair(t, p));
        }
      }
    }
    sort(v.begin(), v.end());
    int cur = 0;
    for (int i = 0; i < v.size(); i++) {
      if (i && sgn1(v[i] - v[i - 1]) != 0) ans = max(ans, cur + 1), cur = 0;
      cur++;
    }
    ans = max(ans, cur + 1);
    sort(w.begin(), w.end());
    cur = 0;
    vector<vector<pair<long double, long double> > > u(1);
    for (int i = 0; i < w.size(); i++) {
      if (i && sgn1(w[i].first - w[i - 1].first) != 0)
        u.push_back(vector<pair<long double, long double> >());
      u.rbegin()->push_back(w[i].second);
    }
    for (auto& x : u) {
      cur = 0;
      sort(x.begin(), x.end(),
           [&](pair<long double, long double> a,
               pair<long double, long double> b) {
             if (sgn2(a.first - b.first)) return a.first < b.first;
             return a.second < b.second;
           });
      for (int i = 0; i < x.size(); i++) {
        if (i == 0)
          cur++;
        else if (sgn2(x[i].first - x[i - 1].first) != 0 ||
                 sgn2(x[i].second - x[i - 1].second) != 0)
          cur++;
      }
      ans = max(ans, cur + 1);
    }
    ans = max(ans, cur + 1);
    for (int j = 1; j <= n; j++) {
      if (i != j)
        a[j].xv += a[i].xv, a[j].yv += a[i].yv, a[j].x0 += a[i].x0,
            a[j].y0 += a[i].y0;
    }
  }
  cout << ans << "\n";
  return 0;
}
