#include <bits/stdc++.h>
typedef struct {
  double x;
  double y;
} POINT;
int dist(POINT a, POINT b) {
  if (((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y)) > 1) {
    return (0);
  }
  return (1);
}
int max(int a, int b) {
  if (a > b) {
    return (a);
  }
  return (b);
}
int main(void) {
  POINT seal[100], t, mi, ma;
  int n;
  int count, ans;
  double i, j;
  int k;
  while (1) {
    scanf("%d", &n);
    if (!n) {
      break;
    }
    mi.x = mi.y = 100;
    ma.x = ma.y = 0;
    for (k = 0; k < n; k++) {
      scanf("%lf%*c%lf", &seal[k].x, &seal[k].y);
    }
    ans = 0;
    for (i = 0; i <= 10; i += 0.05) {
      t.y = i;
      for (j = 0; j <= 10; j += 0.05) {
        t.x = j;
        count = 0;
        for (k = 0; k < n; k++) {
          if (dist(t, seal[k])) {
            count++;
          }
          ans = max(ans, count);
        }
      }
    }
    printf("%d\n", ans);
  }
  return (0);
}
