# Enter your code here. Read input from STDIN. Print output to STDOUT n,m=map(int,raw_input().split(' ')) from fractions import gcd print (n*m)-1#-gcd(n,m)