#include <bits/stdc++.h>
typedef struct {
  double x;
  double y;
} Point;
typedef struct {
  Point start;
  Point end;
} Vector;
Vector cross_point(Point p1, Point p2) {
  double distance = sqrt(pow(p2.x - p1.x, 2.0) + pow(p2.y - p1.y, 2.0));
  double theta = atan2(p2.x - p1.x, p2.y - p1.y);
  double alpha = acos(pow(distance, 2.0) / (2 * distance));
  Vector vec = {};
  vec.start.x = p1.x + cos(theta + alpha);
  vec.start.y = p1.y + cos(theta + alpha);
  vec.end.x = p1.x + cos(theta - alpha);
  vec.end.y = p1.y + cos(theta - alpha);
  return vec;
}
Point sub_point(Point p1, Point p2) {
  Point point = {};
  point.x = p1.x - p2.x;
  point.y = p1.y - p2.y;
  return point;
}
double cross(Point p1, Point p2) { return p1.x * p2.y - p1.y * p2.x; }
bool is_cross(Vector v1, Vector v2) {
  return (cross(sub_point(v1.end, v1.start), sub_point(v2.start, v1.start)) *
              cross(sub_point(v1.end, v1.start), sub_point(v2.end, v1.start)) <
          1.0) &&
         (cross(sub_point(v2.end, v2.start), sub_point(v1.start, v2.start)) *
              cross(sub_point(v2.end, v2.start), sub_point(v1.end, v2.start)) <
          1.0);
}
int count_overlaps(Point* points, int n) {
  int i;
  int j;
  int x;
  int y;
  Vector vectors[100][100] = {};
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      vectors[i][j] = cross_point(points[i], points[j]);
    }
  }
  int max_counts = 1;
  int counts;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      for (x = 0; x < n; x++) {
        counts = 1;
        for (y = 0; y < n; y++) {
          if (is_cross(vectors[i][j], vectors[x][y])) {
            counts++;
          }
        }
        if (counts > max_counts) {
          max_counts = counts;
        }
      }
    }
  }
  return max_counts;
}
int main() {
  while (true) {
    int n;
    scanf("%d", &n);
    if (n == 0) {
      return 0;
    }
    Point points[100] = {};
    int i;
    for (i = 0; i < n; i++) {
      scanf("%lf,%lf", &points[i].x, &points[i].y);
    }
    int count = count_overlaps(points, n);
    printf("%d\n", count);
  }
  return 0;
}
