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