#include <bits/stdc++.h>
using namespace std;
double dif(pair<double, double> a, pair<double, double> b) {
  return sqrt((a.first - b.first) * (a.first - b.first) +
              (a.second - b.second) * (a.second - b.second));
}
int main() {
  int n;
  while (cin >> n && n) {
    int ans = 0;
    vector<pair<double, double> > v;
    for (int i = 0; i < n; i++) {
      pair<double, double> p;
      scanf("%lf,%lf", &p.first, &p.second);
      v.push_back(p);
    }
    for (int i = 0; i < n; i++) {
      int tans = 0;
      for (int l = 0; l < n; l++) {
        if (dif(v[i], v[l]) > 2.0)
          ;
        else
          tans++;
      }
      ans = max(ans, tans);
    }
    cout << ans << endl;
  }
}
