#include using namespace std; int main() {unsigned long long int n,m; cin>>n>>m; if(m==1) cout<m) cout<<(m-1)+m*(n-1)<