#include<iostream>
int main(){for(int m;std::cin>>m,m;){int l[101],*n=l,i,j,p=m,o=0;float a[101],b[101],*c=a,*d=b;for(;m--;){(std::cin>>*c++).ignore()>>*d++;*n++=1;}for(i=0;i<p-1;i++)for(j=i+1;j<p;j++)if((a[j]-a[i])*(a[j]-a[i])+(b[j]-b[i])*(b[j]-b[i])<=4)l[i]++,l[j]++;for(i=1;i<p;i++)if(l[o]<l[i])o=i;std::cout<<l[o]<<'\n';}}