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