#include <stdio.h>
#define SQ(x) ((x) * (x))

typedef struct {
    double x;
    double y;
} POINT;

int dist(POINT a, POINT b)
{
    if (SQ(a.x - b.x) + SQ(a.y - b.y) > 1){
        return (0);
    }
    return (1);
}

int max(int a, int b)
{
    if (a > b){
        return (a);
    }
    return (b);
}

int main(void)
{
    POINT seal[100], t;
    int n;
    int count, ans;
    double i, j;
    int k;
    
    while (1){
        scanf("%d", &n);
        
        if (!n){
            break;
        }
        
        for (i = 0; i < n; i++){
            scanf("%lf%*c%lf", &seal[i].x, &seal[i].y);
        }
        
        ans = 0;
        for (i = 0; i <= 10; i += 0.01){
            t.y = i;
            for (j = 0; j <= 10; j += 0.01){
                t.x = j;
                count = 0;
                for (k = 0; k < n; k++){
                    if (dist(t, seal[k])){
                        count++;
                    }
                    ans = max(ans, count);
                }
            }
        }
        
        printf("%d\n", ans);
    }
    
    return (0);
}