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 = 0
  overlap.each do |k, v|
    s = [k] + v
    v.each {|i| s &= [i] + overlap[i]}
    l = s.size
    max = l if l > max
  end
  puts max
end
