#include <bits/stdc++.h>
int main(void) {
  int n, i, m, t;
  double x[100], y[100], r, c;
  while (scanf("%d", &n) * n) {
    for (i = 0; i < n; i++) scanf("%lf,%lf", &x[i], &y[i]);
    for (t = 0, r = 0.; r <= 10.; r += .01) {
      for (c = 0.f; c <= 10.; c += .01) {
        for (m = 0, i = 0; i < n; i++) {
          if ((x[i] - c) * (x[i] - c) + (y[i] - r) * (y[i] - r) <= 1.) m++;
        }
        if (m > t) t = m;
      }
    }
    printf("%d\n", t);
  }
  return 0;
}
