#include<cstdio>
#include<vector>
using namespace std;
int main(void)
{
	vector<pair<double,double> > point;
	int n;
	int count[100];
	while(1)
	{
		point.clear();
		for(int f1=0;f1<100;f1++)
		{
			count[f1]=0;
		}
		scanf("%d",&n);
		if(n==0)
		{
			break;
		}
		for(int f1=0;f1<n;f1++)
		{
			pair<double,double> p;
			scanf("%lf,%lf",&p.first,&p.second);
			point.push_back(p);
		}
		for(int f1=0;f1<point.size();f1++)
		{
			for(int f2=f1;f2<point.size();f2++)
			{
				double x,y,r;
				x=point[f1].first-point[f2].first;
				y=point[f1].second-point[f2].second;
				r=2;
				if(x*x+y*y<=r*r)
				{
					count[f1]++;
				}
				
			}
		}
		int maxi=0;
		for(int f1=0;f1<100;f1++)
		{
			if(count[f1]>maxi)
			{
				maxi=count[f1];
			}
		}
		printf("%d\n",maxi);
	}
	/*
	fflush(stdin);
	getchar();
	*/
	return 0;
}