#include <bits/stdc++.h>
using namespace std;
int_fast64_t findbanana(int m, int b) {
  int_fast64_t x = m * b;
  int_fast64_t maxb = x * (x + 1) / 2;
  for (int_fast64_t i = 0; i <= x; i++) {
    if (i % m == 0) {
      int_fast64_t ban = 0;
      ban = ((b - (i / m) + 1) * (i + 1) * (b - (i / m) + i)) / 2;
      if (ban > maxb) {
        maxb = ban;
      }
    }
  }
  return maxb;
}
int main() {
  int m, b;
  cin >> m >> b;
  cout << findbanana(m, b);
  return 0;
}
