#include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl

bool in(double x, double y, double xx,double yy){
	return ((x-xx)*(x-xx)+(y-yy)*(y-yy))<=1;
}

int main(){
	li n;
	cin>>n;
	double cx[100],cy[100];
	li c=0;
	while(n>0){
		li res=1;
		rin{
			scanf("%lf,%lf",&cx[i], &cy[i]);
		}
		
		for(double y=0; y<=10.0; y+=0.01){
			for(double x=0; x<=10.0; x+=0.01){
				li count=0;
				rep(k,n){
					if(in(x,y,cx[k],cy[k]))count++;
				}
				res=max(res,count);
			}
		}
		cout<<res<<endl;
		//puts("before cin>>n");
		string gomi;
		//if(c==0)cin>>gomi;
		scanf("%I64d", &n);
		//puts("after cin>>n");
		c++;
		if(n<1) break;
	}
	
	return 0;
}