#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

double dist(pair<double, double> a1, pair<double, double> a2) {
	return pow((a1.fi - a2.fi), 2) + pow((a1.se - a2.se), 2);
}

pii p[110];

signed main(){
	int n;
	while (cin >> n && n) {
		rep(i, 0, n) {
			cin >> p[i].fi;
			cin.ignore();
			cin >> p[i].se;
		}
		int MAX = 0;
		for (double y = 0.00; y <= 10.01; y += 0.01) {
			for (double x = 0.00; x <= 10.01; x += 0.01) {
				int cnt = 0;
				rep(k, 0, n) {
					if (dist(p[k], (make_pair(x, y))) < 1.0001) cnt++;
				}
				MAX = max(MAX, cnt);
			}
		}
		cout << MAX << endl;
	}
}