#include <bits/stdc++.h>
using namespace std;
bool cl(const pair<int, int> &a, const pair<int, int> &b) {
  return a.first < b.first;
}
bool clg(const pair<int, int> &a, const pair<int, int> &b) {
  return a.first > b.first;
}
bool cr(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second < b.second;
}
int dist(pair<int, int> a, pair<int, int> b) {
  if (b.second >= a.first && b.second <= a.second) return 0;
  if (b.first >= a.first && b.first <= a.second) return 0;
  if (b.second <= a.first) return a.first - b.second;
  if (a.second <= b.first) return b.first - a.second;
}
int gcd(int a, int b) {
  int c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
void task(void) {
  long long unsigned m, b;
  scanf("%I64d", &(m));
  ;
  scanf("%I64d", &(b));
  ;
  long long unsigned max = 0, s = 0;
  for (long long unsigned h = 0; h <= b; ++h) {
    long long unsigned w = m * (b - h);
    s = (h + 1) * ((w * (w + 1)) / 2) + ((h * (h + 1)) / 2) * (w + 1);
    if (max < s) max = s;
  }
  printf("%I64d", max);
}
int main(void) { task(); }
