Once, the pupils of the B-th school of city G decided to go to the cinema. The cinema administration placed them in a hall of size n \times m, which was specially chosen so that all the seats were occupied by pupils. Each cinema visitor was given a number.
The pupils took their seats as follows: they entered the hall in numerical order, completely filling the first row, then the second row, then the third, and so on.

However, the class teacher decided that such seating was bad for the pupils' behavior and rearranged them in another way: first, all the first seats in each row were occupied, then all the second seats in each row, and so on (see the picture).

The administration decided to find out how many pupils did not change their seat after the rearrangement.
The first line contains the numbers and (1 \leq n, m \leq 1000).
Print the number of pupils whose seat did not change after the rearrangement.
Example 1
Example 2