#include <bits/stdc++.h>
using namespace std;
double d[110][110];
double dist(pair<double, double> a1, pair<double, double> a2) {
  return sqrt(pow((a1.first - a2.first), 2) + pow((a1.second - a2.second), 2));
}
signed main() {
  long long n;
  while (cin >> n && n) {
    vector<pair<double, double> > p(n);
    for (long long i = 0; i < n; i++) {
      cin >> p[i].first;
      cin.ignore();
      cin >> p[i].second;
    }
    long long MAX = 0;
    for (long long i = 0; i < n; i++) {
      long long cnt = 0;
      for (long long j = 0; j < n; j++) {
        if ((dist(p[i], p[j]) - 2.0) < 1e-8) cnt++;
      }
      MAX = max(MAX, cnt);
    }
    cout << MAX << endl;
  }
}
