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

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