#include <bits/stdc++.h>
using namespace std;
int max(int a, int b) {
  if (a >= b)
    return a;
  else
    return b;
}
int main() {
  int N, count = 1, max_c = 0;
  float x[101] = {}, y[101] = {};
  cin >> N;
  for (int i = 0; i < N; i++) {
    scanf("%f,%f", &x[i], &y[i]);
  }
  for (int i = 0; i < N; i++) {
    count = 1;
    for (int j = i; j < N; j++) {
      if (i != j && sqrt((x[i] - x[j]) * (x[i] - x[j]) +
                         (y[i] - y[j]) * (y[i] - y[j])) <= 2)
        count++;
    }
    max_c = max(max_c, count);
  }
  cout << max_c << endl;
  return 0;
}
