#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int mod = 1000 * 1000 * 1000 + 7;
const long long inf = 1e18;
int cl(int a, int b) {
  if (a % b == 0)
    return a / b;
  else
    return a / b + 1;
}
long long cl(long long a, long long b) {
  if (a % b == 0)
    return a / b;
  else
    return a / b + 1;
}
long long a, c, b, d, e, f, g, h, i, j, k, l, m, n, p, q, r, t, u, w, x, y, z,
    ara[100005], arr[100005], ans = 0;
string s, s2, s3;
vector<long long> v, v2, v3;
int main() {
  cin >> m >> b;
  r = b * m, c = b;
  for (int i = 0; i <= b; i++) {
    x = m * (b - i);
    y = i;
    ans = max(((y + 1) * ((x * (x + 1)) / 2)) + ((x + 1) * ((y * (y + 1)) / 2)),
              ans);
  }
  cout << ans;
  return 0;
}
