#include <bits/stdc++.h>
void swap(int *a, int *b) {
  int t;
  t = *a;
  *a = *b;
  *b = t;
}
bool isCollision(double x1, double y1, double x2, double y2) {
  return (((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)) <=
          ((1 * 2) * (1 * 2)));
}
bool find(int record[], int key, int size) {
  for (int i = 0; i < size; i++) {
    if (record[i] == key) {
      return (true);
    }
  }
  return (false);
}
int main(void) {
  int n;
  double x[100], y[100];
  int count;
  int set[100];
  int answer;
  int min_set[100];
  int min_count;
  while (1) {
    scanf("%d", &n);
    if (n == 0) {
      break;
    }
    for (int i = 0; i < n; i++) {
      scanf("%lf,%lf", &x[i], &y[i]);
      set[i] = i;
    }
    count = n;
    answer = 0;
    for (int i = 0; i < n; i++) {
      if (find(set, i, count) == true) {
        min_count = 1;
        min_set[0] = i;
        swap(&set[i], &set[--count]);
        for (int j = 0; j < count; j++) {
          int k;
          for (k = 0; k < min_count; k++) {
            if (isCollision(x[set[j]], y[set[j]], x[min_set[k]],
                            y[min_set[k]]) == false) {
              break;
            }
          }
          if (k == min_count) {
            min_set[min_count++] = set[j];
            swap(&set[j], &set[--count]);
            j = -1;
          }
        }
        if (min_count > answer) {
          answer = min_count;
        }
      }
    }
    printf("%d\n", answer);
  }
  return (0);
}
