import math
while 1:
    N = int(input())
    if N == 0:
        break
 
    PS = []
    for i in range(N):
        x, y = map(float, input().split(','))
        PS.append((int(x * 100000), int(y * 100000)))
 
    D2 = 100000**2
    ans = 0
    for i in range(101):
        py = i * 10000
        for j in range(101):
            px = j * 10000
            cnt = 0
            for x, y in PS:
                if (px - x) ** 2 + (py - y) ** 2 <= D2:
                    cnt += 1
            ans = max(ans, cnt)
    print(ans)
