#include <bits/stdc++.h>
using namespace std;
double dist(pair<double, double> a1, pair<double, double> a2) {
  return pow((a1.first - a2.first), 2) + pow((a1.second - a2.second), 2);
}
pair<double, double> p[110];
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  while (cin >> n && n) {
    for (long long i = 0; i < n; i++) {
      cin >> p[i].first;
      cin.ignore();
      cin >> p[i].second;
    }
    long long MAX = 0;
    for (double y = 0.00; y <= 10.01; y += 0.01) {
      for (double x = 0.00; x <= 10.01; x += 0.01) {
        long long cnt = 0;
        for (long long k = 0; k < n; k++) {
          if (dist(p[k], (make_pair(x, y))) < 1.0001) cnt++;
        }
        MAX = max(MAX, cnt);
      }
    }
    cout << MAX << endl;
  }
}
