#include <bits/stdc++.h>
static double x[64];
static double y[64];
static int n;
int main() {
  int i, j;
  for (;;) {
    int rval;
    scanf("%d", &n);
    if (n == 0) break;
    for (i = 0; i < n; ++i) {
      scanf("%lf,%lf", &x[i], &y[i]);
    }
    rval = 0;
    for (i = 0; i < n; ++i) {
      int tval = 0;
      for (j = 0; j < n; ++j) {
        tval += !!(((x[j] - x[i]) * (x[j] - x[i])) +
                       ((y[j] - y[i]) * (y[j] - y[i])) <=
                   4.);
      }
      rval = ((rval) < (tval) ? (tval) : (rval));
    }
    printf("%d\n", rval);
  }
  return EXIT_SUCCESS;
}
