#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, b;
  cin >> m >> b;
  long long Max = 0;
  for (long long i = b; i >= 0; i--) {
    long long p = (m * b - m * i + 1) * (i + 1) * (m * b - m * i + i) / 2;
    Max = max(p, Max);
  }
  printf("%I64d", Max);
  return 0;
}
