import std.stdio : write, writeln, writefln, stdin;
import std.array;
import std.range;
import std.typecons;

alias Tuple!(real, real) P;

void main(){
	delim = ",";
	
	while(true){
		int n = next!int();
		if(n==0){ break; }
		
		P[] p = new P[n];
		foreach(i; n.iota){
			p[i][0] = next!real();
			p[i][1] = next!real();
		}
		
		int max_;
		foreach(i; n.iota){
			import std.algorithm : max;
			int cnt;
			foreach(j; n.iota){
				P a = p[i];
				P b = p[j];
				
				if( [b[0]-a[0], b[1]-a[1]].d <= 1*2.){
					++cnt;
				}
			}
			max_ = max(max_, cnt);
		}
		
		writeln = max_;
	}
}

real d(real[2] p){
	import std.math;
	return sqrt(p[0]*p[0] + p[1]*p[1]);
}


import std.stdio : readln, chomp;
import std.conv : to;
import std.string : split;
shared string[] input;
shared string delim = " ";
T next(T)()
in
{
	assert(hasNext());
}
out
{
	input.popFront;
}
body
{
	return input.front.to!T;
}

void next(T)(ref T v){
	v = next!T();
}

bool hasNext(){
	if(input.length > 0){
		return true;
	}
	
	string str = readln;
	if(str.length > 0){
		input ~= str.chomp.split(delim);
		return true;
	}else{
		return false;
	}
}


void dbg(T...)(T vs)
{
	import std.stdio : stderr;
	foreach(v; vs)
		stderr.write(v.to!string ~ " ");
	stderr.write("\n");
}

T clone(T)(T v){
	T v_;
	static if(isInputRange!(T)){
		foreach(ite; v){
			v_ ~= ite.clone;
		}
	}else{
		v_ = v;
	}
	
	return v_;
}