#include using namespace std; #define IO ios_base::sync_with_stdio(false); cin.tie(0); #define endl "\n" #define DBG 666 #define mp make_pair #define revsort(x,y) sort((x),(x+y));reverse((x),(x+y)); typedef long long ll; int main(){ IO; ll n, m; cin >> n >> m; ll res = m-1; res += m*(n-1); cout << res << endl; return 0; }