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