#include #include #include #include #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(m==1) { cout<<(n-1); } else if(n==1) { cout<<(m-1); } else { cout<<((n-1)+((m-1)*n)); } return 0; }