#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T, class T1>
inline void gn(T &first, T1 &second) {
  gn(first);
  gn(second);
}
template <class T, class T1, class T2>
inline void gn(T &first, T1 &second, T2 &z) {
  gn(first);
  gn(second);
  gn(z);
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
template <class T>
inline void printsp(T first) {
  print(first);
  putchar(' ');
}
template <class T>
inline void println(T first) {
  print(first);
  putchar('\n');
}
template <class T, class U>
inline void print(T first, U second) {
  printsp(first);
  println(second);
}
template <class T, class U, class V>
inline void print(T first, U second, V z) {
  printsp(first);
  printsp(second);
  println(z);
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
struct point {
  long double first, second;
  point(long double first = 0, long double second = 0)
      : first(first), second(second) {}
  point operator-(point a) { return point(first - a.first, second - a.second); }
  point operator+(point a) { return point(first + a.first, second + a.second); }
  point operator*(long double a) { return point(first * a, second * a); }
  point operator/(long double a) { return point(first / a, second / a); }
  point operator&(point a) {
    return point(first * a.first - second * a.second,
                 first * a.second + second * a.first);
  }
  point rotate(long double al) { return *this & point(cos(al), sin(al)); }
  long double operator^(point a) { return first * a.second - second * a.first; }
  long double operator*(point a) { return first * a.first + second * a.second; }
  point norm() {
    long double s = nor();
    if (s < 1e-8) return *this;
    return point(first / s, second / s);
  }
  point conj() { return point(-second, first); }
  long double nor() { return sqrtl(*this * *this); }
  long double al() { return atan2l(second, first); }
  bool operator<(const point &a) const {
    if (fabsl(first - a.first) > 1e-8) return first < a.first;
    return second < a.second - 1e-8;
  }
  bool operator>(const point &a) const {
    if (fabsl(first - a.first) > 1e-8) return first > a.first;
    return second > a.second + 1e-8;
  }
  bool operator==(const point &a) const {
    if (fabsl(first - a.first) > 1e-8) return 0;
    return fabsl(second - a.second) < 1e-8;
  }
  void input() {
    int xx, yy;
    gn(xx, yy);
    first = xx, second = yy;
  }
  void print() { printf("%lf %lf\n", first, second); }
};
point p[1010], q[1010];
point pp[1010];
long double tt[1010];
int main() {
  int n;
  gn(n);
  int t1, t2;
  for (int i = 0; i < n; i++) {
    gn(t1);
    p[i].input();
    gn(t2);
    q[i].input();
    q[i] = (q[i] - p[i]) / (t2 - t1);
    p[i] = p[i] + (q[i] * -t1);
  }
  int ans = 1;
  for (int i = 0; i < n; i++) {
    int nn = 0;
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      point a = q[j] - q[i];
      long double al = a.al(), len = a.nor();
      point b = p[i] - p[j];
      long double t = 0;
      if (fabsl(a.first) > 1e-8) t = b.first / a.first;
      if (fabsl(a.second) > 1e-8) t = b.second / a.second;
      if (p[i] + q[i] * t == p[j] + q[j] * t)
        tt[nn] = t, pp[nn++] = point(al, len);
    }
    sort(tt, tt + nn);
    for (int j = 0, k; j < nn; j = k) {
      for (k = j; k < nn && fabsl(tt[k] - tt[j]) < 1e-8; k++)
        ;
      smax(ans, k - j + 1);
    }
    sort(pp, pp + nn);
    for (int j = 0, k; j < nn; j = k) {
      int cnt = 0;
      for (k = j + 1; k < nn && fabsl(pp[k].first - pp[j].first) < 1e-8; k++) {
        if (fabsl(pp[k].second - pp[k - 1].second) > 1e-8) cnt++;
      }
      smax(ans, cnt + 2);
    }
  }
  println(ans);
  return 0;
}
