#include <bits/stdc++.h>
using namespace std;
double Memo[101][101];
void solve() {
  int n;
  while (cin >> n, n) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        Memo[i][j] = 999999999;
      }
    }
    vector<pair<double, double> > Vec(n);
    for (int i = 0; i < n; ++i) {
      scanf("%lf%*c%lf", &Vec[i].first, &Vec[i].second);
    }
    for (int i = 0; i < n; ++i) {
      for (int j = i; j < n; ++j) {
        Memo[i][j] = sqrt(
            (Vec[i].first - Vec[j].first) * (Vec[i].first - Vec[j].first) +
            (Vec[i].second - Vec[j].second) * (Vec[i].second - Vec[j].second));
        Memo[j][i] = Memo[i][j];
      }
    }
    int max_count = 0;
    for (int i = 0; i < n; ++i) {
      int count = 0;
      for (int j = 0; j < n; ++j) {
        if (Memo[i][j] <= 2.0) {
          count++;
        }
      }
      if (max_count < count) {
        max_count = count;
      }
    }
    cout << max_count << endl;
  }
}
int main() {
  solve();
  return (0);
}
