#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define int long long
#define pb push_back
#define all(x) x.begin(), x.end()
 
const int maxn = 1e6 + 5;
const int mod = 1e9 + 7;
 
int rec(int a, int b) {
  if (a < b) swap(a, b);
  int res = a * b;
  if (a == 1 and b == 1) {
    return res;
  }
  if (b == 1) {
    return res + (a * (a + 1) / 2 - 1);
  }
  return res + (b * rec(a, 1));
}
 
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
   
  int a, b;
  cin >> a >> b;
  cout << rec(a, b) << '\n';
}