text: #include<iostream>
  #include<algorithm>
  #include<cmath>
  #include<vector>
  #include<map>
  #include<queue>
  #define rep(i, n) for (int i = 0; i < (n); ++i)
  #define rep1(i, n) for (int i = 1; i < (n); ++i)
  using namespace std;
  using ll = long long;
  using P = pair<int, int>;
  const int INF = 1001001001;
  
  int main() {
    int N, M;
    cin >> N >> M;
  
    int ans = N*(N-1)/2 + M*(M-1)/2;
    cout<< ans << endl;
    return 0;
  }
  
  