double x[100],y[100],t,u,a,b,s;
n,i,j,k,c;
main(m){
	for(;scanf("%d",&n),i=j=n;printf("%d\n",m)){
		for(m=1;i--;scanf("%lf,%lf",x+i,y+i));
		for(i=n;--i;)
			for(j=i-1;j--;)
				if((u=acos(hypot(x[j]-x[i],y[j]-y[i])/2))<9)
					for(s=1,t=atan2(y[j]-y[i],x[j]-x[i]);c=0,s+3;s-=2)
						for(a=x[i]+cos(t+s*u),b=y[i]+sin(t+s*u),k=n;k--;)
							hypot(a-x[k],b-y[k])<1&&++c>m?m=c:0;
	}
}