#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, b, maxx = 0;
  cin >> m >> b;
  for (long long y = 0; y <= b; y++) {
    long long x = (b - y) * m;
    maxx = max(maxx, (x + 1) * (y + 1) * (x + y) / 2);
  }
  if (maxx) cout << maxx << endl;
  return 0;
}
