#include <stdio.h>
#include <math.h>

#define N 100

int main(void){
	int n;
	double x[N], y[N];
	int isHit[N][N];
	int c,max;
	
	while (scanf("%d", &n), n!=0){
		for (int i=0; i<n; i++){
			scanf("%lf,%lf", &x[i], &y[i]);
			for (int j=0; j<=i; j++){
				double dx, dy;
				dx = x[j] - x[i];
				dy = y[j] - y[i];
				isHit[j][i] = isHit[i][j] = sqrt(dx*dx+dy*dy)>2.0?0:1;
			}
		}
		max = 0;
		for (int i=0; i<n; i++){
			c = 0;
			for (int j=0; j<n; j++){
				c += isHit[i][j];
			}
			if (c>max) max = c;
		}
		printf("%d\n", max);
	}
	
	return 0;
}