from math import sin,cos,pi
x=[0]*100;y=[0]*100
h=1000
while 1:
    n=int(input())
    if n==0:break
    a=0
    for i in range(n):x[i],y[i]=map(float,input().split(','))
    for i in range(n):
        for j in range(h):
            cx=x[i]+cos(2*pi*j/h)
            cy=y[i]+sin(2*pi*j/h)
            c=0
            for k in range(n):
                if (cx-x[k])*(cx-x[k])+(cy-y[k])*(cy-y[k])<1.0+1e-7:c+=1
            a=max(a,c)
    print(a)