#include<stdio.h>
int main(void)
{
    int n,i,m,t;
    float x[100],y[100],r,c;
    while(scanf("%d",&n)*n){
        for(i=0;i<n;i++)scanf("%f,%f",&x[i],&y[i]);
        for(t=0,r=0.f;r<=10.f;r+=.01f){
            for(c=0.f;c<=10.f;c+=.01f){
                for(m=0,i=0;i<n;i++){
                    if((x[i]-c)*(x[i]-c)+(y[i]-r)*(y[i]-r)<=1.f)m++;
                }
                if(m>t)t=m;
            }
        }
        printf("%d\n",t);
    }
    return 0;
}