#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;

int n;
double x[200];
double y[200];

double Dis(int a, int b)
{
	return (sqrt((x[a] - x[b]) * (x[a] - x[b]) + (y[a] - y[b]) * (y[a] - y[b])));
}

int maxi;
int use[200];

void Search(int i, int j)
{	
	maxi = max(maxi, j);
	
	if (i == n){
		return;
	}
	
	Search(i + 1, j);
	
	for (int k = 0; k < j; k++){
		if (Dis(use[k], i) - 2.00000 > 0.00000){
			return;
		}
	}
	
	use[j] = i;
	
	Search(i + 1, j + 1);
}

int main()
{
	while (scanf("%d", &n), n){
		maxi = 0;
				
		for (int i = 0; i < n; i++){
			scanf("%lf,%lf", &x[i], &y[i]);
		}
		
		Search(0, 0);
		
		printf("%d\n", maxi);
	}
	
	return 0;
}