import java.io.*; import java.util.*; 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. */ int n; int m; int times; String strValue; String[] strArray = new String[2]; int[] valArray = new int[2] ; // int area; //area = m * n; Scanner scan = new Scanner(System.in); strValue = scan.nextLine(); strArray = strValue.split(" "); for(int i=0; i<2; i++){ valArray[i] = Integer.parseInt(strArray[i]); } m = valArray[0]; n = valArray[1]; times = (m - 1) + n - 1; System.out.println(times); } }