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