Ignus is coming and so are exams. So Ignus managers want to take benefit of the situation and make money out of this. Ignus coordiantor is good friend of the Secretary of ARMA Society. ARMA Society has a magical room. The magical property of the room is that everyone who studies in the room for x seconds, gets x pass-points. The Ignus coordinator asks his friend to give him this room for some days till exams. The Secretary being generous gives him the room till exams. Now he wants to give this room on rent to the IITJ Janata and make profit. But the problem is that every student wants to get the room at his desired time (start time s in seconds) and wants to occupy it for a continuous duration (d in seconds) and is ready to pay amount p for it (as per their requirement to pass the semester :P). No student wants to occupy room for partial time for his/her requirement. And the constraint on magical room is that only one student can study in it at a time.
Ignus coordinator asks everyone to submit their requirements. Now having all requirements listed, he knows that he cannot fulfill everyone's requirement. So he tries to allot the room avoiding any clashes such that it maximizes his profit.
INPUT:
First line of input contains number of students n (1≤n≤10000), who have made requests for the magical room.
In the following n lines, the requirements of each request are given.
Each request is described by 3 integer values:
The start time of request st (0≤st<1000000),
the duration of request d (0<d<1000000)
and the price p (0<p<100000) the student is ready to pay.
OUTPUT:
Print one integer which is the maximum money the coordinator can make.
Student 1 and Student 4 can be allowed to occupy rooms without any clash, hence making money 36. Note that student 1 and student 3 also can be allotted feasibly, but the solution is not optimum because money made is mot maximum possible.