#include <bits/stdc++.h>
using namespace std;
template <typename Tp>
inline void read(Tp& x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
int buf[22];
template <typename Tp>
inline void write(Tp x) {
  int p = 0;
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x == 0)
    buf[++p] = 0;
  else
    while (x) {
      buf[++p] = x % 10;
      x /= 10;
    }
  for (int i = p; i; i--) putchar('0' + buf[i]);
}
int m, b;
int main() {
  scanf("%d%d", &m, &b);
  long long int ans = 0;
  for (int y = 0; y <= b; y++) {
    int x = m * (b - y);
    ans = max(ans, 1ll * (1 + x) * (1 + y) * (x + y) / 2);
  }
  printf("%lld\n", ans);
  return 0;
}
