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