include Math

loop do
	n = gets.to_i
	break if n == 0

	jewels = (1..n).map { gets.split.map(&:to_i) }

	max_num = 1

	jewels.combination(2) do |j1, j2|
		x1, y1, r1, m1 = j1
		x2, y2, r2, m2 = j2
		next if x1 == x2 && y1 == y2

		x3, y3, r3, m3 = x2 - x1, y2 - y1, r2, m2
		
		[r1, r1 + m1].product([r3, r3 + m3]).each do |ar1, ar3|
			[1, -1].repeated_permutation(2) do |sign1, sign2|
				p1 = q1 = nil

				h = ar1 ** 2 + sign1 * ar1 * ar3
				if y3 == 0
					p1 = h.to_f / x3
					d = ar1 **2 - p1 ** 2
					next if d < 0
					q1 = sign2 * sqrt(d)
				else
					a = x3 ** 2 + y3 ** 2
					b = -2 * h * x3
					c = h ** 2 - (r1 * y3) ** 2

					d = b * b - 4 * a * c
					next if d < 0
					
					p1 = (-b + sign2 * sqrt(d)) / (2 * a)
					q1 = (h - p1 * x3).to_f / y3
				end

				s1 = -(ar1 ** 2 + p1 * x1 + q1 * y1)
				
				num = jewels.count do |x, y, r, m|
					d = (p1 * x + q1 * y + s1).abs / sqrt(p1 ** 2 + q1 ** 2)
					r <= d && d <= r + m
				end

				max_num = num if num > max_num
			end
		end
	end
	p max_num
end