Rectangles#5890

Rectangles

1 second
64 megabytes
Hard

For the given rectangles, your task is to find the smallest area that can be covered by these rectangles, allowing them to overlap. Each rectangle is defined by the lengths of its two sides.

Input

The first line contains the integer , representing the number of rectangles. This is followed by lines, each containing two integers that specify the lengths of the sides of a rectangle (1 \le N \le 2 \cdot 10^5, and the lengths of the sides do not exceed 10^9).

Output

Output a single line containing the smallest possible area that can be covered by the rectangles.

Examples

Example 1

Loading
Loading