#include <bits/stdc++.h>
int main(void) {
  double seal_x[100], seal_y[100];
  double dist;
  int kasanari[100];
  int i, j;
  int num;
  int max;
  while (1) {
    scanf("%d", &num);
    if (num == 0) {
      break;
    }
    memset(seal_x, 0, sizeof(seal_x));
    memset(seal_y, 0, sizeof(seal_y));
    for (i = 0; i < num; i++) {
      scanf("%lf%*c%lf", &seal_x[i], &seal_y[i]);
    }
    max = 0;
    memset(kasanari, 0, sizeof(kasanari));
    for (i = 0; i < num; i++) {
      for (j = 0; j < num; j++) {
        if (i == j) {
          continue;
        }
        dist = ((seal_x[j] - seal_x[i]) * (seal_x[j] - seal_x[i])) +
               ((seal_y[j] - seal_y[i]) * (seal_y[j] - seal_y[i]));
        if (0 <= dist && dist <= 4) {
          kasanari[i]++;
        }
      }
      if (max < kasanari[i]) {
        max = kasanari[i];
      }
    }
    printf("%d\n", max + 1);
  }
  return (0);
}
