#include <bits/stdc++.h>
int main(int argc, char **argv) {
  double x[100], y[100];
  int count[100];
  int n;
  int i, j;
  while (true) {
    scanf("%d", &n);
    if (n == 0) break;
    for (i = 0; i < n; ++i) count[i] = 1;
    for (i = 0; i < n; ++i) {
      scanf("%lf,%lf", &x[i], &y[i]);
      for (j = 0; j < i; ++j) {
        double rx = x[i] - x[j];
        double ry = y[i] - y[j];
        if (rx * rx + ry * ry <= 4.0) {
          count[i]++;
          count[j]++;
        }
      }
    }
    int max = 0;
    for (i = 0; i < n; ++i) {
      if (count[i] > max) max = count[i];
    }
    printf("%d\n", max);
  }
  return 0;
}
