#include <iostream>
#include <vector>
#include <complex>
#include <cstdio>
#include <algorithm>
using namespace std;

int main(){
	
	int n;
	double x, y;
	vector< complex< double > > p;
	vector< int > num;
	
	while(cin >> n, n){
		
		p.clear();
		num.clear();
		
		p.resize(n);
		num.resize(n);
		
		for(int i = 0; i < n; ++i){
			scanf("%lf,%lf", &x, &y);
			p[i] = complex< double >(x, y);
			num[i] = 1;
		}
		
		for(int i = 0; i < n; ++i){
			for(int j = i + 1; j < n; ++j){
				if((p[i].real() - p[j].real()) * (p[i].real() - p[j].real()) + (p[i].imag() - p[j].imag()) * (p[i].imag() - p[j].imag()) <= 4.0f){
					++num[i];
					++num[j];
				}
			}
		}
		
		cout << *max_element(num.begin(), num.end()) << endl;
	}
	return 0;
}