#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,ans;
double x[101],y[101],a[101][101];
int main(){
  while(cin>>n,n){
    ans=0;
    r(i,n)scanf("%lf,%lf",&x[i],&y[i]);
    r(i,1000)r(j,1000){
      int a=0;
      r(k,n)if((x[k]-(double)i/100)*(x[k]-(double)i/100)+(y[k]-(double)j/100)*(y[k]-(double)j/100)<=1)a++;
      ans=max(a,ans);
    }
    cout<<ans<<endl;
  }
}