Layout of the city#2768

Layout of the city

1 second
64 megabytes
Very easy

Petya has a model of the central part of a city on his table. The model consists of buildings in the form of rectangular parallelepipeds placed on a flat surface. The buildings may touch each other with their walls.

Petya wants to cover the top and side faces of all buildings with colored paper. He needs to calculate in advance how much paper he will need, taking into account that touching wall parts do not require covering.

Write a program that takes information about the model (for each building, its height and the coordinates of its base are known) and determines the required area of colored paper.

Input

The input file contains an integer (1 \leq N \leq 10^5) — the number of buildings.

Then follow groups of five integers: x_i\ y_i\ u_i\ v_i\ h_i (0 \leq x_i < u_i \leq 10000, 0 \leq y_i < v_i \leq 10000, 0 < h_i \leq 100), where (x_i, y_i) and (u_i, v_i) are the coordinates of two opposite corners of the base of a building in centimeters, and h_i is the height of the building in centimeters.

The bases of the buildings are rectangles with sides parallel to the coordinate axes. The total area of the top and side faces of all buildings, excluding touching parts, does not exceed 10^9.

Output

The output file should contain an integer — the required area in square centimeters.

Examples

Example 1

Loading
Loading