#include <bits/stdc++.h>
using namespace std;
double dist(const pair<double, double>& p, const pair<double, double>& q) {
  double dx = p.first - q.first;
  double dy = p.second - q.second;
  return sqrt(dx * dx + dy * dy);
}
double normalize(double a) { return fmod(a + 2 * M_PI, 2 * M_PI); }
int n;
pair<double, double> c[100];
vector<pair<double, double> > r[100];
int main() {
  while (1) {
    scanf("%d", &n);
    if (n == 0) {
      break;
    }
    for (int i = 0; i < (n); ++i) {
      char comma;
      scanf("%lf%c%lf", &c[i].first, &comma, &c[i].second);
    }
    for (int i = 0; i < (n); ++i) {
      for (int j = 0; j < (n); ++j) {
        if (i == j) {
          continue;
        }
        double d = dist(c[i], c[j]);
        if (d == 0) {
          r[i].push_back(pair<double, double>(0, 2 * M_PI));
        } else if (d <= 2) {
          double ca = atan2(c[j].second - c[i].second, c[j].first - c[i].first);
          double da = acos(d / 2);
          r[i].push_back(
              pair<double, double>(normalize(ca - da), normalize(ca + da)));
        }
      }
    }
    int ans = 0;
    for (int i = 0; i < (n); ++i) {
      vector<double> p;
      for (int j = 0; j < (r[i].size()); ++j) {
        p.push_back(r[i][j].first);
        p.push_back(r[i][j].second);
      }
      sort(p.begin(), p.end());
      vector<int> q(p.size() + 1, 0);
      for (int j = 0; j < (r[i].size()); ++j) {
        if (r[i][j] == pair<double, double>(0, 2 * M_PI)) {
          q[0] += 1;
          q[p.size()] -= 1;
        } else if (r[i][j].first <= r[i][j].second) {
          q[lower_bound(p.begin(), p.end(), r[i][j].first) - p.begin()] += 1;
          q[upper_bound(p.begin(), p.end(), r[i][j].second) - p.begin()] -= 1;
        } else {
          q[0] += 1;
          q[upper_bound(p.begin(), p.end(), r[i][j].second) - p.begin()] -= 1;
          q[lower_bound(p.begin(), p.end(), r[i][j].first) - p.begin()] += 1;
          q[p.size()] -= 1;
        }
      }
      for (int j = 0; j < (p.size()); ++j) {
        q[j + 1] += q[j];
      }
      for (int j = 0; j < (p.size()); ++j) {
        ans = max(ans, q[j] + 1);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
