#include <bits/stdc++.h>
using namespace std;
long long int ans;
int main() {
  int m, b;
  cin >> m >> b;
  for (long long int y = 0; y <= b; y++) {
    long long int X = m * (b - y);
    long long int temp =
        ((y + 1) * X * (X + 1)) / 2 + ((X + 1) * y * (y + 1)) / 2;
    ans = max(ans, temp);
  }
  cout << ans << endl;
  return 0;
}
