#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 1;
long long ans;
int main() {
  int m, b;
  cin >> m >> b;
  for (long long i = 0; i <= b; i++) {
    long long y = i, x = b * m - m * y;
    long long a = ((1 + x) * (1 + y) * (x + y)) / 2;
    ans = max(ans, a);
  }
  cout << ans;
  return 0;
}
