#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> G[100];
int degree[100];
int ans;
double s[(628)];
double c[(628)];
int main(void) {
  double x[100], y[100];
  char use[100];
  int temp;
  for (int i = 0; i < (628); i++) {
    s[i] = sin((6.48 / (628)) * i);
    c[i] = cos((6.48 / (628)) * i);
  }
  while (1) {
    scanf("%d", &n);
    if (n == 0) {
      break;
    }
    for (int i = 0; i < n; i++) {
      scanf("%lf,%lf", &x[i], &y[i]);
      G[i].clear();
    }
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        G[i].push_back(j);
        G[j].push_back(i);
      }
    }
    ans = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < (628); j++) {
        temp = 0;
        for (int k = 0; k < G[i].size(); k++) {
          if (((x[i] + c[j] - x[G[i][k]]) * (x[i] + c[j] - x[G[i][k]])) +
                  ((y[i] + s[i] - y[G[i][k]]) * (y[i] + s[i] - y[G[i][k]])) <=
              4) {
            temp++;
          }
        }
        if (temp > ans) {
          ans = temp;
        }
      }
    }
    printf("%d\n", 102);
    for (int i = 0; i < 10000; i++)
      for (int i = 0; i < 10000; i++)
        ;
  }
  return (0);
}
