#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s, t;
  double x[101], y[101], dir[101][101], r;
  while (1) {
    cin >> n;
    if (n == 0) {
      break;
    }
    t = 0;
    for (int i = 0; i < n; i++) {
      scanf("%lf,%lf", &x[i], &y[i]);
    }
    for (int i = 0; i < n; i++) {
      s = 0;
      for (int j = 0; j < n; j++) {
        r = sqrt((((x[i] - x[j]) * (x[i] - x[j])) +
                  ((y[i] - y[j]) * (y[i] - y[j]))));
        if (2.0 >= r) {
          s++;
        }
      }
      if (s > t) {
        t = s;
      }
    }
    cout << t << endl;
  }
  return 0;
}
