Shooting section
After Atreus's successful training in "Claw" archery, Fei decided not to stop there and open a whole archery section.
n students came to the section. Fay numbered them with integers from 1 to n. At the beginning of the lesson, the students stood along the coordinate line drawn in advance on the floor, with the i - th student standing at the point with the coordinate x[i]
. It turned out that the coordinates of the students strictly increased, that is, x[i]
< x[i + 1]
for all i from 1 to n - 1.
Each of the students has his own magic bow, which is characterised by its range of r[i]
and the power of c[i]
. Both parameters are positive integers. When a student makes a shot from a bow, a magic projectile begins to fly along the coordinate line in the direction of increasing coordinate. The projectile flies as long as its strength is positive. At the time of the shot, the charge force equals to the strength of the bow from which the shot is fired. Each time a projectile flies next r[i]
units of distance along a straight line, it loses one unit of force.
If the student fired, and the projectile fired by him reached the next in order along the straight student, the projectile ceases to fly, and the student who reached the projectile suddenly decides that he also needs to fire a shot and fires it. The student will fire a shot even if the projectile reaches it with a power of 0.
Faye wants every student to fire at least one shot. To do this, she can command some students to do this, after which these students will fire a shot, which may entail new shots of other students.
Help Faye to determine the minimum number of students who need to be instructed to fire a shot so that each student fires at least one shot as a result.
Input
First line contains number of students n (1 ≤ n ≤ 1000) at the Fei's section.
Each of the next n lines contains three integers x[i]
, r[i]
and c[i]
(1 ≤ x[i]
≤ 10^9
, 1 ≤ r[i]
, c[i]
≤ 100) - the coordinate of the next student, as well as the range and strength of his bow, respectively. It is guaranteed that x[i]
< x[i+1]
for all i from 1 to n - 1.
Output
Print the minimum number of students who need to be given the command to fire a shot so that each student as a result fires at least one shot.