float x[100],y[100],A,h,X,Y,C,S;i,j,k,s,m,M;main(n){for(;~scanf("%d",&n);n&&printf("%d\n",M+2)){M=-1;for(i=n;i--;)scanf("%f,%f",x+i,y+i);for(i=n;i-->0;)for(j=i;j--;)if(A=hypot(x[i]-x[j],y[i]-y[j])/2,A<=1)for(S=atan2(y[i]-y[j],x[i]-x[j]),C=cos(S),S=sin(S),h=sqrt(1-A*A),s=2;s--;h=-h)for(m=0,k=n;k--;M=m>M?m:M)m+=k-i&&k-j&&hypot(x[j]+A*C-h*S-x[k],y[j]+A*S+h*C-y[k])<=1;}}