#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>

using namespace std;

typedef pair<double,double> P;

int main(void){
  int n;
  double x[100],y[100];

  while(cin >> n,n){
    vector<P>d;

    for(int i=0;i<n;i++)
      scanf("%lf,%lf",&x[i],&y[i]);
    
    for(int i=0;i<n;i++){
      for(int j=i+1;j<n;j++){
	double L=pow(x[i]-x[j],2)+pow(y[i]-y[j],2);
	if(L>4.000)continue;
	L=sqrt(L);
	double theta=atan2(y[j]-y[i],x[j]-x[i]);
	double a=acos(L/2);
	d.push_back(make_pair(x[i]+cos(theta+a),y[i]+sin(theta+a)));
	d.push_back(make_pair(x[i]+cos(theta-a),y[i]+sin(theta-a)));
      }
    }

    for(int i=0;i<d.size();i++){
      cout << d[i].first << " " <<d[i].second << endl;
    }

    int count,ans=1;
    for(int i=0;i<d.size();i++){
      count=0;
      
      for(int j=0;j<n;j++){
	if(pow(d[i].first-x[j],2)+pow(d[i].second-y[j],2)<=1.0){
	  count++;
	}
      }
	ans=max(ans,count);
    }
    cout << ans << endl;
  }
  return 0;
}