#include <bits/stdc++.h>
using namespace std;
int dx[4] = {0, 0, -1, 1};
int dy[4] = {1, -1, 0, 0};
int main() {
  int m, b;
  cin >> m >> b;
  long long int ans = 0;
  for (int y = 0; y < b; y += 1) {
    int x = m * (b - y);
    long long int cnt = 1LL * (y + 1) * (x + 1) * (x + y) / 2;
    ans = max(ans, cnt);
  }
  cout << ans << '\n';
}
