#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long m, b;
  cin >> m >> b;
  long long mx = 0;
  for (long long i = 0, j = b * m; i <= b; i++, j -= m) {
    mx = max(mx, ((i + 1) * (j + 1) * (i + j)) / 2);
  }
  cout << mx;
  return 0;
}
