#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 (b <= 0 || a <= 0) return 0;
  if (a == 1 && b == 1) return 1;
  if (a > b) swap(a, b);
  return a * b + rec(a, b-1) + 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);
}
