#include "bits/stdc++.h"
using namespace std;
 
#define ff first
#define sz size
#define in insert
#define sp " "
#define pb push_back
#define ss second
typedef long long ll;
typedef long double ld;
#define rall(x) (x).rbegin(), (x).rend()
#define all(x) (x).begin(), (x).end()
 
ll gcd (ll a, ll b) {
    return b ? gcd (b, a % b) : a;
}
ll lcm (ll a, ll b) {
    return a / gcd (a, b) * b;
}
 
const ll N = (ll)1e5+7;
const ll M = (ll)1e9+7;
const ll mn = LLONG_MIN;
const ll mx = LLONG_MAX;

 
 
ll m[2*N];
void solve() {
    ll n, w;
    cin>>n>>w;
    ll sum1=((n*(n+1))/2*w)-w;
    ll sum2=((w*(w+1))/2);
    if(w>1)sum2+=w-1;
    cout<<sum1+sum2*n;
}

signed main() {     
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    cout.tie(NULL);
 
    ll T = 1;
    // cin>>T;
    while(T--) solve();
}
