Laser#3032

Laser

1 second
128 megabytes
Medium

Scientists in Byteland have developed a new laser to aid in their research. Before it can be put into practical use, the laser must undergo testing at a secret site in Byteland.

The testing area is a rectangle of size N-1 by M-1 meters, divided into squares of 1\ \mathrm{m}^2 by vertical and horizontal lines. This area can be visualized as a grid with N-1 rows and M-1 columns. The horizontal lines are numbered from bottom to top starting at , and the vertical lines from left to right, also starting at . Thus, each intersection of a vertical and horizontal line (a total of N \times M intersections) can be identified by a pair of numbers (X, Y), which are called the coordinates of the point: is the vertical line number, and is the horizontal line number at the intersection.

The laser is positioned at the coordinates . At every other intersection point, sensors are installed, which are triggered when the laser beam passes through them. The laser can fire from to any other intersection. Only the sensors belonging to the segment with endpoints at the starting coordinates of the laser and the chosen target point will be triggered. Note that all sensors and the laser are located on the same plane.

Figure 1. Description of the first example. N = 3,\ M = 6,\ A = 1,\ B = 1

A shot at the point triggers the sensors and , while shots at the points and only trigger the sensors at the endpoints. After shots at all other points, sensors , , , and are triggered times each; sensor , times; sensor , times; sensor , times; and the rest time each. In total, all sensors are triggered times.

During the tests, the scientists fire the laser from the starting point to every other point on the grid exactly once. Your task is to determine the total number of times all sensors on the testing field are triggered.

Input

The input consists of a single line containing four integers, separated by spaces: , (2 \leq N,\ M \leq 1000000), (1 \leq A \leq M), and (1 \leq B \leq N).

Output

Print a single integer — the total number of times all sensors on the field are triggered.

Examples

Example 1

Loading
Loading