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 scan = new Scanner(System.in); int row, column; row = scan.nextInt(); column = scan.nextInt(); int numOfCut = 0, count = 0; int numCutRow = 0; numCutRow = row - 1; if (column != 1 && column != 0){ numOfCut = column - 1; } if (row != 1){ while (count < column){ numOfCut = numOfCut + numCutRow; count++; } } System.out.println(numOfCut); } }