include Math
EPS = 1e-2

loop do
  n = gets.to_i
  break if n == 0
  jewels = (1..n).map { gets.split.map(&:to_i) }

  max_num = 1
  (0..n-1).to_a.combination(2) do |i, j|
    x1, y1, r1, m1 = jewels[i]
    x2, y2, _, _ = jewels[j]
    t = atan2(y2 - y1, x2 - x1)
    shifted = jewels.map {|x, y, r, m| [x - x1, y - y1, r, m] }
    transformed = shifted.map {|x, y, r, m| [cos(-t) * x - sin(-t) * y, sin(-t) * x + cos(-t) * y, r, m] }
    x2, _, r2, m2 = transformed[j]

    [r1, r1 + m1].product([r2, r2 + m2]).each do |ar1, ar2|
      [1, -1].repeated_permutation(2) do |sign1, sign2|
        s = (ar1**2 + sign1 * ar1 * ar2) / x2.to_f
        next if ar1.abs < s.abs - EPS
        t = sign2 * sqrt([ar1 ** 2 - s ** 2, 0].max)

        num = transformed.count do |x, y, r, m|
          d = (s * x + t * y - ar1 ** 2).abs / ar1
          r - EPS <= d && d <= r + m + EPS
        end
        max_num = num if num > max_num
      end
    end
  end
  p max_num
end
