#include<stdio.h>
int main(void)
{
    int n,i,j,m,t;
    double x[101],y[101];
    while(~scanf("%d",&n)){
        if(!n)break;
        for(i=0;i<n;i++){
            scanf("%lf,%lf",&x[i],&y[i]);
        }
        t=0;
        for(i=0;i<n;i++){
            for(m=0,j=0;j<n;j++){
                if((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])<=4.0)m++;
            }
            if(m>t)t=m;
        }
        printf("%d\n",t);
    }
    return 0;
}