<?php

define("R", 1.0);

$x = array();
$y = array();

while(true){
	$num = intval(fgets(STDIN));
	if($num == 0){
		break;
	}
	mainLoop();
}



function mainLoop(){
	global $x, $y, $num;
	
	$x = array();
	$y = array();
	
	for($i = 0; $i < $num; $i++){
		$buf = fgets(STDIN);
		$arr = explode(",", $buf);
		$x[$i] = floatval($arr[0]);
		$y[$i] = floatval($arr[1]);
	}
	
	// 総当たり
	$max = 0;
	for($dx = 0.0; $dx <= 10.0; $dx += 0.1){
		for($dy = 0.0; $dy <= 10.0; $dy += 0.1){
			$p = koten($dx, $dy);
			if($p > $max){
				$max = $p;
			}
		}
	}
	
	echo $max."\n";
}


function koten($dx, $dy){
	global $x, $y, $num;
	
	$ret = 0;
	for($k = 0; $k < $num; $k++){
		$r2 = ($x[$k] - $dx)*($x[$k] - $dx) + ($y[$k] - $dy)*($y[$k] - $dy);
		if($r2 <= R*R){
			// 円の内側
			$ret++;
		}
	}
	
	return $ret;
}