Parquet

A brick-like tiling of the plane shifts by half a tile on every other row; count the tiles touching the border of an axis-aligned rectangle.

Medium7MathImplementationGeometryBrute forceNo attempts yetTime limit1sMemory limit128 MB

Problem

Mirko's parquet floor is made of 1×11 \times 1 square tiles laid in the following pattern.

The picture shows only part of the floor in an imaginary coordinate system. The floor is so large that you may assume it covers the whole plane.

Precisely, the pattern is as follows. For every integer kk, the line y=ky = k is a tile boundary. In the row kyk+1k \le y \le k + 1, if kk is even, the tiles are [m,m+1]×[k,k+1][m, m + 1] \times [k, k + 1], and if kk is odd, the tiles are [m+0.5,m+1.5]×[k,k+1][m + 0.5, m + 1.5] \times [k, k + 1], for every integer mm.

For his mathematics thesis, Mirko drew a rectangle on the floor with red paint. Later he found out that the paint contains a harmful chemical that destroys the parquet. Now he has to replace every tile that shares at least one point with the border of the drawn rectangle. Help Mirko: how many such tiles are there?

Input

The first line contains real numbers x1x_1 and y1y_1, the coordinates of the lower left corner of the rectangle.

The second line contains real numbers x2x_2 and y2y_2, the coordinates of the upper right corner of the rectangle. The sides of the rectangle are parallel to the coordinate axes.

Every coordinate has at most one digit after the decimal point, and 0<x1<x21090 < x_1 < x_2 \le 10^9, 0<y1<y21090 < y_1 < y_2 \le 10^9.

Output

Print the number of tiles that must be replaced on a single line.

Hint

The picture shows the rectangle of the first example (red) and the 22 tiles that must be replaced (gray).