#include <bits/stdc++.h>
using namespace std;
long long m, b;
void solve() {
  long long maxx, minn, x, y, sum, da;
  maxx = m * b;
  minn = m;
  da = 0;
  for (x = 0; x <= maxx; x++) {
    y = (maxx - x) / minn;
    sum = (x + 1) * (y * (y + 1) / 2) + (y + 1) * (x * (x + 1) / 2);
    da = max(da, sum);
  }
  cout << da << endl;
}
int main() {
  while (cin >> m >> b) solve();
}
