#include <bits/stdc++.h>
using namespace std;
void preprocess(void) { return; }
int main(void) {
  preprocess();
  int t;
  t = 1;
  for (int z = 1; z <= t; z++) {
    long long m, b;
    scanf("%lld", &m), scanf("%lld", &b);
    long long ans = -1;
    for (long long i = 0; i <= b; i++) {
      long long x = (b - i) * m;
      long long tans = (x + 1) * (i + 1) * (x + i) / 2;
      if (ans < tans) {
        ans = tans;
      }
    }
    printf("%lld\n", ans);
  }
  return 0;
}
