Blocked Billboard#10509

Blocked Billboard

1 second
128 megabytes
Easy

During long milking sessions, Bessie the cow likes to stare out the window of her barn at two huge rectangular billboards across the street advertising "Farmer Alex's Amazingly Appetizing Alfalfa" and "Farmer Greg's Great Grain". The pictures of these two cow feed products on the billboards look much tastier to Bessie than the grass on her farm.

One day, as Bessie is staring out the window, she is alarmed to see a huge rectangular truck parked across the street. The side of the truck has an advertisement for "Farmer Smith's Superb Steaks", which Bessie doesn't quite understand. She is mostly concerned that the truck may block her view of her two favorite billboards.

Given the locations of the two billboards and the location of the truck, calculate the total combined area of the two billboards that remains visible. The truck may obscure neither billboard, both billboards, or only one of them.

Input

The first line contains four integers x_1, y_1, x_2, y_2, where (x_1, y_1) and (x_2, y_2) are the coordinates of the lower-left and upper-right corners of the first billboard, respectively. The next line contains four more integers specifying the lower-left and upper-right corners of the second billboard in the same way. The third and final line of input contains four integers specifying the lower-left and upper-right corners of the truck.

All coordinates are in the range . The two billboards are guaranteed not to overlap with each other in any positive-area region.

Output

Print the total combined area of the two billboards that remains visible.

Examples

Here, units of area from the first billboard and units of area from the second billboard remain visible.

Example 1

Loading
Loading