# AOJ 0090 Overlaps of Seals

class Vector2D
  attr_accessor :x, :y

  def initialize(x, y)
    @x = x
    @y = y
  end

  def +(other)
    Vector2D.new(@x + other.x, @y + other.y)
  end

  def -(other)
    Vector2D.new(@x - other.x, @y - other.y)
  end

  def r2
    @x * @x + @y * @y
  end
end

while line = gets
  n = line.to_i
  break if n.zero?

  points = []
  n.times do
    x, y = gets.split(",").map {|v| v.to_f}
    points << Vector2D.new(x, y)
  end

  adj = Array.new(n * (n - 1) / 2, 0)
  points.each_with_index do |pi, i|
    other_points = points[(i + 1)..-1]
    other_points.each.with_index do |pj, j|
      if (pj - pi).r2 <= 4
        # 重なっている
        adj_start = i * (n - 1) - i * (i - 1) / 2
        adj[adj_start + j] = 1
      end
    end
  end

  sum = Array.new(n - 1, 0)
  (n - 1).times do |i|
    adj_start = i * (n - 1) - i * (i - 1) / 2
    adj_end = adj_start + n - i - 2
    sum << adj[adj_start..adj_end].reduce(0, :+)
  end

  puts sum.max + 1
end