#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  long long m, b;
  cin >> m >> b;
  long long yi = 0;
  long long K = m * b;
  long long max = 0;
  long long res;
  while (yi <= b) {
    res = (K + yi) * (K + 1) * (yi + 1) / 2;
    if (res > max) {
      max = res;
    }
    yi++;
    K = K - m;
  }
  cout << max << endl;
  return 0;
}
