#include <bits/stdc++.h>
using namespace std;

using ll=long long;
#define int ll

#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=a;i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif

template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;

using pi=pair<int,int>;
using vi=vc<int>;

template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p.a<<","<<p.b<<"}";
}

template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}

using ld=long double;
using cm=complex<ld>;
#define x real()
#define y imag()
const ld eps=1e-8;
const ld PI=acos(ld(-1));
int sgn(ld a){return a<-eps?-1:(a>eps?1:0);}
ld dot(cm a,cm b){return a.x*b.x+a.y*b.y;}
ld crs(cm a,cm b){return a.x*b.y-a.y*b.x;}
ld crs(cm a,cm b,cm c){return crs(b-a,c-a);}
int ccw(cm a,cm b){return sgn(crs(a,b));}
int ccw(cm a,cm b,cm c){return ccw(b-a,c-a);}
auto cmcmp=[](cm a,cm b){
	int s=sgn(a.x-b.x);
	if(s)return s<0;
	else return sgn(a.y-b.y)<0;
};
bool cmeq(cm a,cm b){
	return sgn(a.x-b.x)==0&&sgn(a.y-b.y)==0;
};
//(-pi,0](0,pi]
int argtype(cm a){
	if(sgn(a.y)==0)return a.x<0?1:0;
	return a.y<0?0:1;
}
int argcmp(cm a,cm b){
	int at=argtype(a),bt=argtype(b);
	if(at!=bt)return at<bt?-1:1;
	return -ccw(a,b);
};

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
	
	while(1){
		int n;cin>>n;
		if(n==0)break;
		vc<cm> vs;
		rep(i,n){
			ld a,b;
			char c;
			cin>>a>>c>>b;
			vs.eb(a,b);
		}
		const ld p2=2*PI;
		int ans=1;
		rep(r,n){
			using pl=pair<ld,ld>;
			vc<pl> qs;
			const auto add=[&](ld a,ld b){
				while(sgn(b-a-p2)>0)b-=p2;
				while(sgn(b-a)<0)b+=p2;
				while(sgn(a)<0){
					a+=p2;
					b+=p2;
				}
				if(b>p2){
					qs.eb(a,p2);
					qs.eb(0,b-p2);
				}else{
					qs.eb(a,b);
				}
			};
			rep(i,n)if(i!=r){
				cm a=vs[i]-vs[r];
				dmp(vs[i]);
				dmp(vs[r]);
				dmp(a);
				a/=norm(a);
				a*=2;
				ld len=abs(a);
				if(sgn(len-1)<0)continue;
				chmax(len,1);
				ld c=arg(a),d=acos(1/len);
				dmp(len);
				dmp(c);
				dmp(d);
				add(c-d,c+d);
			}
			vc<ld> pos{0,p2};
			for(auto q:qs){
				pos.pb(q.a);
				pos.pb(q.b);
			}
			sort(all(pos));
			dmp(pos);
			pos.erase(unique(all(pos),cmeq),pos.ed);
			dmp(pos);
			int s=pos.size();
			vi sum(s);
			for(auto q:qs){
				int a=lower_bound(all(pos),q.a-eps)-pos.bg;
				int b=lower_bound(all(pos),q.b-eps)-pos.bg;
				dmp(a);
				dmp(b);
				rng(i,a,b+1)
					sum[i]++;
			}
			rep(i,s)
				chmax(ans,sum[i]+1);
		}
		cout<<ans<<endl;
	}
}

