#include <iostream>
#include <cmath>
#define mult(x,y) ((x-y)*(x-y))

using namespace std;

int main()
{
	int n, s, t;
	double x[101], y[101], dir[101][101], r;
	
	while(1){
		cin >> n;
		if(n == 0){
			break;
		}
		t = 0;
		for(int i = 0; i < n; i++){
			scanf("%lf,%lf", &x[i], &y[i]);
		}
		
		for(int i = 0; i < n; i++){
			s = 0;
			for(int j = 0; j < n; j++){
				r = sqrt((mult(x[i], x[j])+mult(y[i], y[j])));
				if(2.0 >= r){
					s++;
				}
			}
			if(s > t){
				t = s;
			}
		}
		cout << t << endl;
	}
	
	return 0;
}