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

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