eolymp
bolt
Try our new interface for solving problems
Problems

Layout of the city

Layout of the city

Time limit 1 second
Memory limit 64 MiB

At Petya on the table is a layout of the city center. Layout of buildings is an N in the form of rectangular parallelepipeds, located on a flat surface. The buildings are very close touch the walls.

Peter wants to paste over the top and side faces of all buildings with colored paper. He decided to pre-calculate how much paper it would need, given that the adjoining parts of the walls can not hang.

Required to write a program that takes as input the information about the layout (for each building is known for its height and position the base) and displays the desired area of ​​the paper.

Input data

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

This is followed by N quintuples of integers: x_i y_i u_i v_i h_{i (}0x_i < u_i ≤ 10000, 0y_i < v_i10000, 0 < h_i100_{)}, where (x_i, y_i) and (u_i, v_i) — the coordinates of the two opposite corners of the base of the building in centimeters, h_i — building height in centimeters.

Foundations of buildings are rectangles with sides parallel to coordinate axes. The sum of the upper and side faces of all buildings, excluding contiguous units does not exceed 10^9.

Output data

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

Examples

Input example #1
1
0 5 5 7 3
Output example #1
52