#include <bits/stdc++.h>
int main(void) {
  int n;
  int i, j;
  int over = 1, max = 1;
  while (scanf("%d", &n) != EOF) {
    if (n == 0)
      break;
    else {
      double x[n], y[n];
      max = 1;
      for (i = 0; i < n; i++) {
        scanf("%lf,%lf", &x[i], &y[i]);
        over = 1;
        for (j = 0; j < i; j++) {
          if ((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]) <=
              4)
            over++;
        }
        if (max < over) max = over;
      }
      printf("%d\n", max);
    }
  }
  return 0;
}
