#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()

using namespace std;
void query(){

    ll a, b;
    cin >> a >> b;
    if(a < b)swap(a, b);
    int s = (a*(a+1)/2)*b;
    s += (a-1)*b;
    s += (b*(b+1)/2-1)*a;
    cout << s;
}
int main(){
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

    ll TT = 1;

    //cin >> TT;

    while(TT--){
        query();
    }

    return 0;
}

/**

*/
