A city block contains n buildings. Building i is a rectangle standing on the ground: it spans horizontally from left to right (left < right) and has height height. Looking at the block from far away, the buildings form a silhouette (the skyline). A key point is a position where the silhouette's height changes as you scan from left to right; the standard skyline is the minimal list of such points, and it always ends with the point where the silhouette drops back to height 0 on the far right. Report the number of key points in this minimal skyline.
Input format
Line 1: an integer n.
Next n lines: three integers left, right, height describing one building.
Output format
A single integer: the number of key points in the skyline.
Constraints
- 1 ≤ n ≤ 100000
- 0 ≤ left < right ≤ 1000000000
- 1 ≤ height ≤ 1000000000