Alternative Architecture
![\includegraphics[width=0.3\textwidth ]{rotated-plate.png}](/problems/alternativearchitecture/file/statement/en/img-0001.png)
After an exchange with some other Lego creators he came across a technique that will allow him to place his buildings at different angles. Each building rests on a rectangular ground plate, to the underside of which he attaches four round $1\times 1$-plates in the corners. These $1\times 1$-plates are then placed on four studs of the base plate, like in Figure 1.
If the ground plate of the building is $a\times b$ studs, what is the number of orientations it can be placed in using this technique, so that all the corner plates exactly fit on studs of the base plate?
Input
The input consists of:
-
One line with two integers $a$ and $b$ ($2 \le a,b \le 10^6$), the dimensions of the ground plate the building is resting on.
Output
Output one integer, the number of different orientations the ground plate can be placed in.
| Sample Input 1 | Sample Output 1 |
|---|---|
6 11 |
6 |
| Sample Input 2 | Sample Output 2 |
|---|---|
26 26 |
5 |
| Sample Input 3 | Sample Output 3 |
|---|---|
123 456 |
2 |
| Sample Input 4 | Sample Output 4 |
|---|---|
3 3 |
1 |
