#include <bits/stdc++.h>
using namespace std;
double dist(double x1, double y1, double x2, double y2) {
  return ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
int main(void) {
  double tx[101], ty[101];
  int n;
  char k;
  while (cin >> n) {
    if (n == 0 || cin.eof()) break;
    for (int i = 0; i < n; i++) cin >> tx[i] >> k >> ty[i];
    double ds[101][101];
    int cnt[101] = {0};
    for (int i = 0; i < n; i++)
      for (int j = i + 1; j < n; j++)
        ds[i][j] = dist(tx[i], ty[i], tx[j], ty[j]);
    for (int i = 0; i < n; i++)
      for (int j = i + 1; j < n; j++)
        if (ds[i][j] <= 4.0) {
          cnt[i]++;
          cnt[j]++;
        }
    int mx = 0;
    for (int i = 0; i < n; i++) mx = max(mx, cnt[i]);
    cout << (mx + 1) << endl;
  }
  return 0;
}
