# The Shadow

Time Limit: 2000 ms

Memory Limit: 65535 ms

## Description

When this semester is over, fish-head feels extremely sorry about the oldest teammates’ leaving. So he gathered all the teamers, went out for photos. Sunsets beautifully shone at the horizon and all the teamers stood in line and got lost in the scene.
Fish-head suddenly found the shadow of teamers was kind of funny. All the teamers were so strong that their shadow almost became rectangle!
Now fish-head wants to know how much the area of the shadow down there.
Everyone’s shadow is lined up straight towards the sun so we just regard it as a line and each shadow as rectangle. Each rectangle has 3 parameters: Ai, Bi, Hi. The shadow begins with Ai (point), ends with Bi (point), and its height is Hi.

## Output

Line 1: The total area, in square units, of the pattern formed by all N teamers’ shadow.