#include<iostream>
#include<string>
#include<stdio.h>
using namespace std;

int main(){
	
	float x[100],y[100];
	int n,i,j,max=0;
	int overlap[100]={};
	
	while(cin>>n,n){
		
		for(i=0;i<n;++i){
			scanf("%f,%f",&x[i],&y[i]);
			
			for(j=0;j<i;++j){
				if( (x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]) <= 4 ){
					++overlap[j];
					++overlap[i];
				}
			}
		}
		
		for(i=0;i<n;++i)if(overlap[i]>max)max=overlap[i];
		cout<<max+1<<endl;
	}
	
	return 0;
}