#include #define ll long long using namespace std; int main() { ll n,m; cin>>n>>m; ll int maxy=max(n,m); ll int miny=min(n,m); cout<<(maxy-1)+(maxy*(miny-1)); return 0; }