def sdist(p1,p2):
    return (p1[0]-p2[0])**2+(p1[1]-p2[1])**2

while True:
    n = int(raw_input())
    if n == 0: break
    p = [map(float, raw_input().split(",")) for i in range(n)]
    mx = 1
    for i in range(n):
        m = 1
        for p1 in p:
            if p1 == p[i]: continue
            if sdist(p[i],p1) <= 4.0 :
                m += 1
        if m > mx: mx = m
    print mx