#include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>
using namespace std;
typedef pair<double,double> P;
#define x first
#define y second
double dif(P a,P b)
{
	return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
int main()
{
	int n;
	while(cin>>n&&n)
	{
		int ans=0;
		vector<P> v;
		for(int i=0;i<n;i++)
		{
			P p;
			scanf("%lf,%lf",&p.x,&p.y);
			
			v.push_back(p);
		}
		for(int i=0;i<n;i++)
		{
			int tans=0;
			for(int l=0;l<n;l++)
			{
				if(dif(v[i],v[l])>2.0);else tans++;
			}
			ans=max(ans,tans);
		}
		cout<<ans<<endl;
	}
	
	
}