#include <bits/stdc++.h>
double s[101][2];
int main() {
  int n, i, j, c, max = 0;
  while (scanf("%d", &n) && n) {
    for (i = 0; i < n; i++) scanf("%lf,%lf", &s[i][0], &s[i][1]);
    for (i = 0; i < n; i++) {
      c = 1;
      for (j = 0; j < n; j++)
        if (i != j)
          if (4 >= ((s[i][0] - s[j][0]) * (s[i][0] - s[j][0])) +
                       ((s[i][1] - s[j][1]) * (s[i][1] - s[j][1])))
            c++;
      max = c > max ? c : max;
    }
    printf("%d\n", max);
  }
  return 0;
}
