#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

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

#define MAX 101
#define R 1
#define POW(x) ((x)*(x))
int n;
double x[MAX], y[MAX];

bool is_intersected(int i, int j)
{
	return POW(x[i]-x[j])+POW(y[i]-y[j])<POW(R+R);
}

int main()
{
	while (cin >> n, n) {
		rep(i, n) {
			char ch;
			cin >> x[i] >> ch >> y[i];
		}
		int ans = 0;
		rep(i, n) {
			int buf = 0;
			rep(j, n)
				if (is_intersected(i, j))
					buf++;
			ans = max(ans, buf);
		}
		cout << ans << endl;
	}
	return 0;
}