#include <bits/stdc++.h>
using namespace std;
bool in(double x, double y, double xx, double yy) {
  return ((x - xx) * (x - xx) + (y - yy) * (y - yy)) <= 1;
}
int main() {
  long long int res = 0;
  long long int n, gomi;
  cin >> n;
  double cx[100], cy[100];
  for (int i = 0; i < ((int)(n)); i++) {
    scanf("%lf,%lf", &cx[i], &cy[i]);
  }
  cin >> gomi;
  for (double y = 0; y <= 10.0; y += 0.01) {
    for (double x = 0; x <= 10.0; x += 0.01) {
      long long int count = 0;
      for (int k = 0; k < ((int)(n)); k++) {
        if (in(x, y, cx[k], cy[k])) count++;
      }
      res = max(res, count);
    }
  }
  cout << res << endl;
  return 0;
}
