#include <bits/stdc++.h>
int main() {
  float *a = new float[101], *b = new float[101], *c = a, *d = b;
  int m, *l = new int[101], *n = l, i, j, o = 0;
  std::cin >> m;
  for (;;) {
    std::cin >> *a++;
    if (!a[-1]) break;
    std::cin.ignore() >> *b++;
    *l++ = 1;
  }
  for (i = 0; i < m - 1; i++)
    for (j = i + 1; j < m; j++)
      if ((c[j] - c[i]) * (c[j] - c[i]) + (d[j] - d[i]) * (d[j] - d[i]) <= 4)
        n[i]++, n[j]++;
  for (i = 1; i < m; i++)
    if (n[o] < n[i]) o = i;
  std::cout << n[o] << '\n';
}
