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