#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, b;
  cin >> m >> b;
  long long x = 0, y = b;
  long long ans = 0;
  while (x >= 0 && y >= 0) {
    long long cans = (x + 1) * (y) * (y + 1) / 2 + (y + 1) * (x) * (x + 1) / 2;
    ans = max(ans, cans);
    x += m;
    y--;
  }
  cout << ans << "\n";
  return 0;
}
