Олимпиадный тренинг

Задача 39058. sea ​​battle


Задача

Темы:

To diversify the game «sea battle» Borya decided to add a new type of ships to it. These ships are made up of two rectangles. The first rectangle has a width w1 and a height h1, and the second rectangle is < code>w2 and h2 respectively. The rectangles are placed one above the other and aligned to the left (see the example pictures): let's introduce a coordinate system on the field so that the lower left cell of the first rectangle has the coordinates (1,1). Then the upper right cell of the first rectangle has the coordinates (w1,h1), the lower left cell of the second rectangle has coordinates (1,h1+1), and the upper right cell of the second rectangle has coordinates (w2,h 1+h2).

According to the rules of naval combat, after the destruction of the ship, it is necessary to mark all the cells adjacent to the side or corner with the cells in which there is a ship, because other ships can no longer stand in these cells. In this case, only cells that do not belong to the ship are marked.

Determine how many squares will need to be marked after the destruction of the ship invented by Borealis. The field on which the game takes place is endless in all directions.

 

Input
Four lines contain four integers w1,h1,w2  and h2 (1<=w1,h1< /sub>,w2,h2<=108) - width of first rectangle, height of first rectangle, width of second rectangle and the height of the second rectangle, respectively.


Imprint
Print a single integer — the number of cells that need to be painted over after the destruction of the ship.


Note

In the first example, the field looks like this (the first rectangle is red, the second rectangle is blue, the marked points are green):

In the second example, the field looks like this:

 
Examples
# Input Output
1 2
1
2
1
12
2 2
2
1
2
16