while n = gets.to_i
  break if n == 0
  overlap = {}
  circle = []
  n.times{|i|
    overlap[i] = [i]
    x, y = gets.split(",").map(&:to_f)
    circle.each_with_index{|it, j|
      if (it[0]-x)**2 + (it[1]-y)**2 <= 4.0
        overlap[i] << j
        overlap[j] << i
      end
    }
    circle[i] = [x, y]
  }
  max = 0
  overlap.uniq.sort {|a, b| b[1].size <=> a[1].size}.each{|k, arr|
    break if max >= arr.size
    org = overlap[arr[0]]
    arr.each{|i|
      org &= overlap[i]
    }
    max = org.size if max < org.size
  }
  puts max
end