#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, b, x, y, i, area, mx = 0;
  scanf("%lld %lld", &m, &b);
  for (i = 1; i <= b; i++) {
    x = m * i;
    y = -i + b;
    area = (x + 1) * (y + 1) * (x + y) / 2;
    if (area > mx) mx = area;
  }
  printf("%lld", mx);
  return 0;
}
