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