#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, b;
  while (scanf("%lld%lld", &m, &b) != EOF) {
    long long maxx = 0;
    for (int i = 0; i <= b; i++) {
      int x = m * (b - i);
      if ((long long)(0.5 * (x + i) * (x + 1) * (i + 1)) > maxx)
        maxx = (long long)(0.5 * (x + i) * (x + 1) * (i + 1));
    }
    printf("%lld\n", maxx);
  }
}
