M=999;main(n,i,j,k,a,b,c){
    float p=atan(1)*4,X[100],Y[100],x,y;
    for(;scanf("%d",&n),n;printf("%d\n",a)){
        for(i=0;i<n;i++)scanf("%f,%f",X+i,Y+i);
        for(a=i=0;i<n;i++){
            for(b=k=0;k<M;k++){
                x=X[i]+cos(p*k/M),y=Y[i]+sin(p*k/M);
                for(c=0,j=0;j<=i;j++){
                    if((X[j]-x)*(X[j]-x)+(Y[j]-y)*(Y[j]-y)<1+1e-3)c++;
                }
                if(b<c)b=c;
            }
            if(a<b)a=b;
        }
    }
exit(0);}