#include <iostream>
#include <iomanip>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>

using namespace std;

#define PI 3.14159264348979323
#define EPS 1e-7
#define PARTITION 1000

int main() {
	int n;
	while (cin >> n && n) {
		double x[100], y[100];
		for (int i = 0; i < n; i++)
			scanf("%lf,%lf\n", &x[i], &y[i]);
		int ans = 0;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < PARTITION; j++) {
				double cx, cy;
				cx = x[i] + cos(2 * PI * j / PARTITION);
				cy = y[i] + sin(2 * PI * j / PARTITION);
				int cnt = 0;
				for (int k = 0; k < n; k++)
					if ((cx - x[k]) * (cx - x[k]) + (cy - y[k]) * (cy - y[k]) < 1.0 + EPS)
						cnt++;
				ans = max(ans, cnt);
			}
		}
		cout << ans << endl;
	}
	return 0;
}