#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(x) x.begin(), x.end()
#define pb push_back
#define size(x) (int)x.size()
#define ll long long
#define ff first
#define ss second
#define endl '\n'
#define fr first
#define sc second
#define ld long double

template <typename _T>
bool chmin(_T &a, const _T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename _T>
bool chmax(_T &a, const _T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

const int mod = 998244353;
const int MOD = 1e9 + 7;
const int inf = 1e9 + 7;
const int INF = 1e18 + 7;
const double eps = 1e-6;
const double EPS = 1e-9;

int x , y ;

void solve() {
  cin >> x >> y ;
  cout << (x*(x+1)/2+x-1)*y+x*(y*(y+1)/2-1) ;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int tt = 1;
  //cin >> tt;
  while(tt--) {
    solve();
  }
}
