#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

typedef pair<double, double> P;

double dist(const P& p, const P& q){
	double dx = p.first - q.first;
	double dy = p.second - q.second;
	return sqrt(dx * dx + dy * dy);
}

double normalize(double a){
	return fmod(a + 2 * M_PI, 2 * M_PI);
}

int n;
P c[100];
vector<P> r[100];

int main(){
	while(1){
		scanf("%d", &n);
		if(n == 0){
			break;
		}

		rep(i, n){
			char comma;
			scanf("%lf%c%lf", &c[i].first, &comma, &c[i].second);
		}

		rep(i, n){
			rep(j, n){
				if(i == j){
					continue;
				}

				double d = dist(c[i], c[j]);
				if(d == 0){
					r[i].push_back(P(0, 2 * M_PI));
				}
				else if(d <= 2){
					double ca = atan2(c[j].second - c[i].second, c[j].first - c[i].first);
					double da = acos(d / 2);
					r[i].push_back(P(normalize(ca - da), normalize(ca + da)));
				}
			}
		}

		int ans = 0;
		rep(i, n){
			vector<double> p;
			rep(j, r[i].size()){
				p.push_back(r[i][j].first);
				p.push_back(r[i][j].second);
			}

			sort(p.begin(), p.end());
			
			vector<int> q(p.size() + 1, 0);
			rep(j, r[i].size()){
				if(r[i][j] == P(0, 2 * M_PI)){
					q[0] += 1;
					q[p.size()] -= 1;
				}
				else if(r[i][j].first <= r[i][j].second){
					q[lower_bound(p.begin(), p.end(), r[i][j].first) - p.begin()] += 1;
					q[upper_bound(p.begin(), p.end(), r[i][j].second) - p.begin()] -= 1;
				}
				else{
					q[0] += 1;
					q[upper_bound(p.begin(), p.end(), r[i][j].second) - p.begin()] -= 1;
					q[lower_bound(p.begin(), p.end(), r[i][j].first) - p.begin()] += 1;
					q[p.size()] -= 1;
				}
			}

			rep(j, p.size()){
				q[j + 1] += q[j];
			}

			rep(j, p.size()){
				ans = max(ans, q[j] + 1);
			}
		}
		printf("%d\n", ans);

		rep(i, n){
			r[i].clear();
		}
	}
	return 0;
}