#include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long int n,m; cin>>n>>m; if(n>m) cout<<((m-1)+(m)*(n-1)); else cout<<((n-1)+(n)*(m-1)); return 0; }