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