#include <bits/stdc++.h>
typedef struct {
  double x;
  double y;
} POINT;
int dist(POINT a, POINT b, double d) {
  if (((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y)) > d) {
    return (0);
  }
  return (1);
}
int max(int a, int b) {
  if (a > b) {
    return (a);
  }
  return (b);
}
int main(void) {
  POINT seal[100], v;
  static POINT l[100000];
  int s;
  double a, a0, d, t;
  int n;
  int count, ans;
  int i, j, k;
  while (1) {
    scanf("%d", &n);
    if (!n) {
      break;
    }
    for (i = 0; i < n; i++) {
      scanf("%lf%*c%lf", &seal[i].x, &seal[i].y);
    }
    s = 0;
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        if (dist(seal[i], seal[j], 4) && i != j) {
          d = sqrt(((seal[i].x - seal[j].x) * (seal[i].x - seal[j].x)) +
                   ((seal[i].y - seal[j].y) * (seal[i].y - seal[j].y)));
          a = atan2(seal[j].y - seal[i].y, seal[j].x - seal[i].x);
          a0 = acos(0.5 * d);
          l[s].x = seal[i].x + cos(a + a0);
          l[s].y = seal[i].y + sin(a + a0);
          s++;
          l[s].x = seal[i].x + cos(a - a0);
          l[s].y = seal[i].y + sin(a - a0);
          s++;
        }
      }
    }
    ans = 0;
    for (i = 0; i < s; i++) {
      count = 0;
      for (j = 0; j < n; j++) {
        if (dist(seal[j], l[i], 1)) {
          count++;
        }
      }
      ans = max(ans, count);
    }
    printf("%d\n", ans);
  }
  return (0);
}
