eolymp
bolt
Try our new interface for solving problems
Problems

Sandwiches

Sandwiches

Pasha likes to cook sandwiches. His trademark sandwich "Coupe" he prepares the four main ingredients: the top piece of bread, a slice of cheese, slice of ham and bottom piece of bread. All ingredients are rectangular form. Once he decided to quickly make this sandwich. To do this, he threw the ingredients into the air in the hope that they will fall and will develop themselves in order. However, the ingredients are dropped on the table, disorderly manner.

Pasha is also a big fan of the game "Tic-tac-toe", so the cloth on his desk looks like a checkered plane. Fast typing on my desk grid, Pasha calculated in which cells which ingredient has fallen, and it turned out that every ingredient was a rectangle with corners at points with integer coordinates and sides parallel to coordinate axes.

prb1149-1

Now Pasha began to wonder what the total area on the table to take his sandwich. Your task in this to write a program that computes this area.

Input

Contains four lines, each containing four integers - the coordinates of the lower left and upper right corner of the next ingredient.

Coordinate grid is introduced so that the first coordinate increases from left to right, and the second from the bottom up.

All the numbers in the input file for the module does not exceed 1000.

Output

Print a single integer - the answer to the problem.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2 0 5 2
0 1 3 6
1 3 5 7
4 1 6 5
Output example #1
35
Input example #2
0 0 2 1
0 0 1 2
1 0 2 2
0 1 2 2
Output example #2
4
Source 2009 Цикл интернет-олимпиад для школьников. First olympiad, base level, September 19, Problem I