#include <bits/stdc++.h>
using namespace std;
int main() {
  double m;
  double b;
  scanf("%lf", &m);
  scanf("%lf", &b);
  int x_max = b * m;
  long long sum_max = 0;
  for (int x = 0; x <= x_max; x++) {
    int y = b - x / m;
    long long sum = 0;
    long long sum_x = (long long)x * (x + 1) / 2;
    long long sum_y = (long long)y * (y + 1) / 2;
    sum = sum_x * (y + 1) + sum_y * (x + 1);
    if (sum > sum_max) sum_max = sum;
  }
  printf("%I64d", sum_max);
  return 0;
}
