#include <bits/stdc++.h>
using namespace std;
long long m, b, sum, ans;
double f(long long x) { return -1.0 * x / m + b; }
int main() {
  scanf("%I64d %I64d", &m, &b);
  for (long long x = 0; x <= m * b; ++x) {
    long long y = (long long)f(x);
    ans = max(ans, (1 + y) * y / 2 * (x + 1) + (1 + x) * x / 2 * (y + 1));
  }
  printf("%I64d\n", ans);
  return 0;
}
