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) { Scanner scan=new Scanner(System.in); long x=scan.nextLong(); long y=scan.nextLong(); if(y==1) System.out.println(x-1); else{ long m=y-1; long n=(x-1)*y; long ans=m+n; System.out.println(ans); } /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ } }