#include <iostream>
#include <vector>
using namespace std;
int main()
{
    unsigned long long a, b;
    cin >> a >> b;
    if (a > b) {
        swap(a, b);
    }

    if (a == 1) {
        unsigned long long res = a * b * 2;
        res += (b * (b - 1) / 2) - 1;
        cout << res;
        return 0;
    }

    unsigned long long res = a * b * 2;
    while (b > 1) {
        res += a * (b--);
    }
    cout << res;
    return 0;
}