#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; bool reduce = false; long long res = 0; cin >> n >> m; if(n > 1) { n--; res += n; } if(m > 1) { m--; res += (n+1) * m; } cout << res << endl; return 0; }