double gaisinx(double a,double b,double c,double d,double e,double f){
		c-=a,d-=b,e-=a,f-=b;
		return ((c*c+d*d)*f-(e*e+f*f)*d)/(2*(c*f-d*e))+a;
}

int main(){
	double x[100],y[100];
	int a,b,c,d,e,f,g,i,j;
	for(;scanf("%d",&a),a;printf("%d\n",e)){
		i=gaisinx(x[b],y[b],x[c],y[c],x[d],y[d]);
		j=gaisinx(y[b],x[b],y[c],x[c],y[d],x[d]);
		for(b=0;b-a;scanf("%lf,%lf",x+b++,y+b));
		for(e=b=0;b<a;b++)
			for(c=b+1;c<a;c++)
				for(d=c+1;d<a;d++)
					for(f=g=0;g<a;e=f>e?f:e)
						if(hypot(i-x[g++],y[g])<=1)f++;														
        }
}