#include <iostream>
#include <math.h>

using namespace std;

double length(double x1, double y1, double x2, double y2){
    return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

bool intersection(double x1, double y1, double x2, double y2, double ret[2][2]){
    double l = length(x1,y1,x2,y2);
    if(l>2.0) return false;
    double theat = atan((y2-y1)/(x2-x1));
    double alpha = acos(l/2.0);
    //cout<<theat<<" "<<alpha<<endl;
    //cout<<theat+alpha<<endl;
    
    ret[0][0]=x1+cos(theat+alpha);
    ret[0][1]=y1+sin(theat+alpha);
    ret[1][0]=x1+cos(theat-alpha);
    ret[1][1]=y1+sin(theat-alpha);
    return  true;
}
/*
int main(){
    double x1,x2,y1,y2;
    cin>>x1>>y1>>x2>>y2;
    double ret[2][2];
    cout<<length(x1, y1, x2, y2)<<endl;
    intersection(x1, y1, x2, y2, ret);
    cout<<ret[0][0]<< " "<<ret[0][1]<<endl;
    cout<<ret[1][0]<< " "<<ret[1][1]<<endl;
    
}*/


int main(){
    int n;
    double seals[100][2]={0};
    cin>>n;
    for(int i=0; i<n; i++){
        scanf("%lf,%lf",&seals[i][0],&seals[i][1]);
        //cin>>seals[i][0]>>seals[i][1];
    }

    
    int max_seals=0;
    
    for(int i=0; i<n; i++){
        for(int j=i+1; j<n; j++){
            double ret[2][2]={0};
            if(intersection(seals[i][0], seals[i][1], seals[j][0], seals[j][1], ret)){
                //一個目
                //cout<<ret[0][0]<<" "<<ret[0][1]<<endl;
                int counter=0;
                for(int k=0; k<n; k++){
                    double l=length(ret[0][0], ret[0][1], seals[k][0], seals[k][1]);
                    if(l<=1.0)counter++;
                }
                max_seals=max(counter,max_seals);
                //二個目
                counter=0;
                for(int k=0; k<n; k++){
                    double l = length(ret[1][0], ret[1][1], seals[k][0], seals[k][1]);
                    if(l<=1.0)counter++;
                }
                max_seals=max(counter,max_seals);
            }
        }
    }
    
    cout<<max_seals+1<<endl;
}