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