n,m = map(int, input().split()) print((n-1)+(m-1)*n)