#include <stdio.h>

float point[300][2] = { { 0.0 } };
int search(int num);

int main(void) {
	int i, num;
	char e;

	while (scanf("%d\n", &num), num) {
		for (i = 0; i < num; i++) {
			scanf("%f %f\n", &point[i][0], &point[i][1]);
			scanf("%c", &e);
		}
		printf("%d\n", search(num));
	}
	return 0;
}

int search(int num) {
	float x, y;
	int i, count, maxcount = 0;
	for (x = 1; x < 10; x++) {
		for (y = 1; y < 10; y++) {
			count = 0;
			for (i = 0; i < num; i++) {
				if (1.0 >= ((x - point[i][0]) * (x - point[i][0]) + (y - point[i][1]) * (y - point[i][1]))) {
					count++;
				}
			}
			if (count > maxcount) {
				maxcount = count;
			}
			if (maxcount == num) {
				return maxcount;
			}
		}
	}
	return maxcount;
}