def check(ary1, ary2)
  ary1.each do |a|
    return false unless ary2.include?(a)
  end
  true
end

until (n = $<.gets.to_i).zero?
  overlap = Hash.new([])
  positions = []
  n.times do |i|
    x, y = $<.gets.split(",").map(&:to_f)
    positions.each_with_index do |po, j|
      x1, y1 = po
      if Math.sqrt((x1 - x) ** 2 + (y1 - y) ** 2) < 2.0
        overlap[j] += [i]
        overlap[i] += [j]
      end
    end
    positions << [x, y]
  end
  max = 1
  overlap.each do |k, v|
    i = v.size
    next if i + 1 <= max
    while i > 0
      f = true
      v.combination(i) do |ary|
        ary.each {|b| f = false unless check(ary - [b], overlap[b])}
      end
      if f
        max = i + 1 if i + 1 > max
        break
      end
      i -= 1
    end
  end
  puts max
end
