#include <bits/stdc++.h>
#define range(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) range(i,0,n)
using namespace std;

typedef complex<double> P;
const double eps=1.0e-10;
P points[210];
P rel[210][210];

int main(void){
	int n;
	while(cin >> n,n){
		rep(i,n){
			double x,y; char tmp;
			cin >> x >> tmp >> y;
			points[i]={x,y};
		}
		rep(i,n)rep(j,n) rel[i][j]=(points[i]+points[j])/P(2.0,0.0);

		int ans=0;
		rep(i,n)rep(j,n){
			int cur=0;
			rep(k,n) if(abs(points[k]-rel[i][j])<1.0+eps) cur++;
			ans=max(ans,cur);
		}
		cout << ans << endl;
	}
	return 0;
}