import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner sc = new Scanner(System.in); int m = sc.nextInt(); int n = sc.nextInt(); BigInteger result; if (n == 1) { result = BigInteger.valueOf(m-1); } else { result = BigInteger.valueOf(m-1).add(BigInteger.valueOf(n-1).multiply(BigInteger.valueOf(m))); } System.out.println(result.toString()); } }