#include <iostream>
#include <vector>
#define ll long long int
using namespace std;

int main() {
    ll a,b;
    cin  >> a >> b;
    ll dp[a+1][b+1];
    dp[1][1] = 1;
    for(int m=2; m <= a; m++) {
        dp[m][1] = dp[m-1][1]+(1*(m))+1;
    }
    for(int m=2;m <= b;m++){
        dp[a][m] = dp[a][m-1]+(a*(m))+a+((2+a)*(a-1))/2;
    }
    cout <<  dp[a][b];
    return 0;
}
