#include<bits/stdc++.h>
using namespace std;

int main() {
    long long n, m;
    cin >> n >> m;
    long long s = 0, k = 0, t;
    s = n * m;
    t = n;
    if (n == 1 && m == 1) {
        cout << 1;
        return 0;
    }
    while (n != 0) {
        s += n * m;
        n--;
    }
    k = (t - 1) * m;
    cout << s + k;
}
