def calc(a, b)
  (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2 <= 4.0 + 1e-10
end
while n = gets.to_i
  break if n == 0
  dots = Array.new(n)
  cnt = Array.new(n,1)
  n.times {|i| dots[i] = gets.split(",").map(&:to_f)}
  n.times do |i|
    ((i+1)...n).each do |j|
      if calc(dots[i], dots[j])
        cnt[i] += 1
        cnt[j] += 1
      end
    end
  end
  p cnt.max
end