#include <iostream> using namespace std; int n; int m; int res; int main() { cin>>n>>m; res=(n-1)*(m-1)-1; cout<<res<<endl; return 0; }