#include<iostream>
using namespace std;

#define M 100

bool e[M][M], f[M];
int n;
int ptr[M];

bool match(int s) {
	f[s] = true;
	for(int i=0; i<n; ++i) {
		if(!e[s][i]) continue;
		if(ptr[i]==-1 || (!f[ptr[i]]&&match(ptr[i]))) {
			ptr[s] = i; ptr[i] = s;
			return true;
		}
	}
	return false;
}


double dist(double x1, double y1, double x2, double y2) {
	double xx = x1-x2, yy = y1-y2;
	return xx*xx+yy*yy;
}

int main() {
	double x[M], y[M];
	char dm;
	int ans;
	while(1) {
		cin >> n;
		if(!n) break;
		for(int i=0; i<n; ++i) cin >> x[i] >> dm >> y[i];
		for(int i=0; i<n; ++i) {
			e[i][i] = false;
			for(int j=i+1; j<n; ++j) {
				if(dist(x[i], y[i], x[j], y[j])<=4.000000) {
					e[i][j] = e[j][i] = false;
				}else {
					e[i][j] = e[j][i] = true;
				}
			}
		}
		ans = n;
		for(int i=0; i<n; ++i) ptr[i] = -1;
		for(int i=0; i<n; ++i) {
			if(ptr[i]==-1) {
				for(int j=0; j<n; ++j) f[j] = false;
				if(match(i)) ans--;
			}
		}
		cout << ans << endl;
	}
}