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