Construction
Once a representative of the Accounts Chamber of the Russian Federation Igor D. Traffic visited a military unit, taking into account № 192.168.0.9 and watched the construction of its soldiers. He noticed that when the soldiers lined up in rows by N columns, ranks in the last N-1 was the soldier, and when the same number of soldiers lined up in rows of M columns, the last ranks of M-1 was the soldier. All other ranks were full.
Later he took on this data set the number of soldiers in the unit. He understood that uniquely identify this number can not, therefore decided to limit myself by finding the minimum possible number of soldiers. This role is to delegate to his deputy, ie You. From what you and congratulations.
Input
The input file are given two positive integers N and M are separated by a space (2 ≤ N, M ≤ 150000).
Output
The output file output a single number: the required minimum number of soldiers in the unit. It is guaranteed that it fits in the range Longint.