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