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 in = new Scanner(System.in); BigDecimal n = in.nextBigDecimal(); BigDecimal m = in.nextBigDecimal(); //System.out.println("n =="+n); // 3 //System.out.println("m =="+m); //2 BigDecimal columnCut = m.subtract(new BigDecimal(1)); BigDecimal rowCut = (n.subtract(new BigDecimal(1))).multiply(m); //BigDecimal totalCut = System.out.println(columnCut.add(rowCut)); } }