#include <bits/stdc++.h>
int main(void) {
  int i, num, j, k;
  int n;
  double x[110], y[110];
  int count, maxcount, ans[100000];
  char hoge;
  for (i = 0;; i++) {
    scanf("%d", &n);
    if (n == 0) break;
    for (j = 0; j < n; j++) {
      scanf("%lf%c%lf", &x[j], &hoge, &y[j]);
    }
    maxcount = 0;
    for (j = 0; j < n; j++) {
      count = 0;
      for (k = 0; k < n; k++) {
        if (((x[k] - x[j]) * (x[k] - x[j]) + (y[k] - y[j]) * (y[k] - y[j])) <=
            4.0) {
          count++;
        }
      }
      if (maxcount < count) maxcount = count;
    }
    ans[i] = maxcount;
  }
  num = i;
  for (i = 0; i < num; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
