#include <iostream>
#define ll long long int
using namespace std;
int main() {
    ll a,b;
    cin >> a >> b;
    ll sum,c;
    c = a+((2+a)*(a-1))/2;
    sum = c + a * (b-1) + (a*(2+b)*(b-1))/2+((b-1)*(2+a)*(a-1))/2;
    cout << sum;
    return 0;
}
