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