# City Horizon

Very easy

Execution time limit is 1 second

Runtime memory usage limit is 128 megabytes

Farmer John has taken his cows on a trip to the city! As the sun sets, the cows gaze at the city horizon and observe the beautiful silhouettes formed by the rectangular buildings.

The entire horizon is represented by a number line with $n$ buildings. Building $i$'s silhouette has a base that spans locations $a_{i}$ through $b_{i}$ along the horizon and has height $h_{i}$. Determine the area, in square units, of the aggregate silhouette formed by all $n$ buildings.

## Input

The first line contains a single integer $n(1≤n≤40000)$. Each of the next $n$ lines describes building $i$ with three integers: $a_{i},b_{i}(1≤a_{i}<b_{i}≤10_{9})$ and $h_{i}(1≤h_{i}≤10_{9})$.

## Output

Print the total area, in square units, of the silhouettes formed by all $n$ buildings.

## Examples

Input #1

Answer #1

Submissions 519

Acceptance rate 50%