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