import java.util.*;

public class Main{
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        
        int n = Integer.parseInt(str);
        String[] strCor = new String[n];
        String[][] strZahyo = new String[n][2];
        double[][] zahyo = new double[n][2];
        
        int cnt = 0;
        int cntMax = 0;
        
        for(int i = 0; i < n; i++){
        	strCor[i] = sc.nextLine();
        	strZahyo[i] = strCor[i].split(","); 
        	zahyo[i][0] = Double.parseDouble(strZahyo[i][0]);
        	zahyo[i][1] = Double.parseDouble(strZahyo[i][1]);
        }
        
        if(Integer.parseInt(sc.nextLine()) == 0){
        	sc.close();
        }
        
        for(int i = 0; i < n; i++){
        	for(int j = i; j < n; j++){
        		if(isOverlap(zahyo[i][0], zahyo[i][1], zahyo[j][0], zahyo[j][1])){
        			cnt++;
        		}
        		if(cnt >= cntMax){
        			cntMax = cnt;
        		}
        	}
        	cnt = 1;
        }     
        
        System.out.println(cntMax);
	}

	
	/**
	 * @param x1     ??????????????????x??§?¨?
	 * @param y1     ??????????????????y??§?¨?
	 * @param x2 ??????2????????????x??§?¨?
	 * @param y2     ???2????????????y??§?¨?
	 * @return??????2????????±?????????????????°true????????????????????°false
	 */
	private static boolean isOverlap(double x1, double y1, double x2, double y2){
		
		double r1 = 1.000000;
		double r2 = 1.000000;
        double  eps = 1e-4;
		boolean result = false;
		
		if(Math.abs( distance(x1,y1,x2,y2) - ( r1 + r2 ) ) <= eps){
			result = true;
		}else{
			result = false;
		}
		return result;
	}
	
	/**
	 * @param x1     ??????????????????x??§?¨?
	 * @param y1     ??????????????????y??§?¨?
	 * @param x2     ???2????????????x??§?¨?
	 * @param y2     ???2????????????y??§?¨?
	 * @return??????2???????????????????????¢
	 */
	private static double distance(double x1, double y1, double x2, double y2){

		double dx = x1 - x2;
		double dy = y1 - y2;
		
		return Math.sqrt(dx*dx+dy*dy);
	}
}