stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long Long;



int main(){

	ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

	Long n,m;cin>>n>>m; 

	Long resp=0;

	resp=(n*(n-1))/2+((m)*(m-1))/2,

	cout<<resp;

}

// Faster C++ solution for the same problem (measured speedup: 5.321731758550083x):
#include <stdio.h>

int main(){

    int n,m;

    scanf("%d %d",&n,&m);

    printf("%d\n",n*(n-1)/2+m*(m-1)/2);

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define ll long long

const int N = 300005;



int n, m , ans;



int main()

{

    cin >> n >> m;

    ans = (n+m)*(n+m-1);

    ans/=2;

    ans-= (n*m);



    cout << ans;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.250956937573321x):
#include <stdio.h>

int main(){

    int n,m;

    scanf("%d %d",&n,&m);

    printf("%d\n",n*(n-1)/2+m*(m-1)/2);

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

int n,a,b,c;

cin>>a>>b;

cout<<((a*(a-1))/2)+((b*(b-1))/2)<<endl;

return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.259069601428778x):
#include <stdio.h>

int main(){

    int n,m;

    scanf("%d %d",&n,&m);

    printf("%d\n",n*(n-1)/2+m*(m-1)/2);

}
// Slower C++ solution:
/*

 Abu Jafor Mohammad Saleh

 ios_base :: sync_with_stdio(false);

 cin.tie(NULL);

 

 */



#include<cstdio>

#include<iomanip>

#include<sstream>

#include<cstdlib>

#include<cctype>

#include<cmath>

#include<algorithm>

#include<set>

#include<queue>

#include<deque>

#include<stack>

#include<list>

#include<iostream>

#include<fstream>

#include<numeric>

#include<string>

#include<vector>

#include<cstring>

#include<map>

#include<iterator>

#include<limits>

#include <algorithm>

#include <unordered_map>

#include<fstream>

#define f first

#define s second

#define MOD 1000003



#define INF (int)1e9

#define PI 3.1415926535897932384626433832795

#define BOUNDARY(i, j) ((i >= 0 && i < rows) && (j >= 0 && j < coloums))



//#include<bits/stdc++.h>

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long

const int maxn = 100001;

using namespace std;

int X[] = {0, 1, 0, -1};

int Y[] = {-1, 0, 1, 0};

int rows,coloums;

long long  gcd(long long  a, long long b)

{

    if (b == 0)

        return a;

    return gcd(b, a % b);

}



int main()

{

    fast;

    ll n,m;

    cin>>n>>m;

    

    ll x = (n*(n-1))/2;

    ll y = (m*(m-1))/2;

    cout<<(x+y)<<endl;

    

}


// Faster C++ solution for the same problem (measured speedup: 5.326351399764886x):
#include <stdio.h>



int main(){

    int m, n;

    scanf("%d %d", &m, &n);



    int totalm=(m*(m-1))/2;

    int totaln=(n*(n-1))/2;

    printf("%d\n", totalm+totaln);





    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;



int main(){

	ios::sync_with_stdio(0);cin.tie(NULL);

	

	int n,m; cin>>n>>m;

	cout<<(n)*(n-1)/2+(m)*(m-1)/2<<endl;

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.329800063082648x):
#include <stdio.h>



int main(){

    int m, n;

    scanf("%d %d", &m, &n);



    int totalm=(m*(m-1))/2;

    int totaln=(n*(n-1))/2;

    printf("%d\n", totalm+totaln);





    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long Long;



int main(){

	ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

	Long n,m;cin>>n>>m; 

	Long resp=0;

	resp=(n*(n-1))/2+((m)*(m-1))/2,

	cout<<resp;

}

// Faster C++ solution for the same problem (measured speedup: 5.321731758550083x):
#include <stdio.h>



int main(){

    int m, n;

    scanf("%d %d", &m, &n);



    int totalm=(m*(m-1))/2;

    int totaln=(n*(n-1))/2;

    printf("%d\n", totalm+totaln);





    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define ll long long

const int N = 300005;



int n, m , ans;



int main()

{

    cin >> n >> m;

    ans = (n+m)*(n+m-1);

    ans/=2;

    ans-= (n*m);



    cout << ans;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.250956937573321x):
#include <stdio.h>



int main(){

    int m, n;

    scanf("%d %d", &m, &n);



    int totalm=(m*(m-1))/2;

    int totaln=(n*(n-1))/2;

    printf("%d\n", totalm+totaln);





    return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

int n,a,b,c;

cin>>a>>b;

cout<<((a*(a-1))/2)+((b*(b-1))/2)<<endl;

return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.259069601428778x):
#include <stdio.h>



int main(){

    int m, n;

    scanf("%d %d", &m, &n);



    int totalm=(m*(m-1))/2;

    int totaln=(n*(n-1))/2;

    printf("%d\n", totalm+totaln);





    return 0;

}
// Slower C++ solution:
/*

 Abu Jafor Mohammad Saleh

 ios_base :: sync_with_stdio(false);

 cin.tie(NULL);

 

 */



#include<cstdio>

#include<iomanip>

#include<sstream>

#include<cstdlib>

#include<cctype>

#include<cmath>

#include<algorithm>

#include<set>

#include<queue>

#include<deque>

#include<stack>

#include<list>

#include<iostream>

#include<fstream>

#include<numeric>

#include<string>

#include<vector>

#include<cstring>

#include<map>

#include<iterator>

#include<limits>

#include <algorithm>

#include <unordered_map>

#include<fstream>

#define f first

#define s second

#define MOD 1000003



#define INF (int)1e9

#define PI 3.1415926535897932384626433832795

#define BOUNDARY(i, j) ((i >= 0 && i < rows) && (j >= 0 && j < coloums))



//#include<bits/stdc++.h>

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long

const int maxn = 100001;

using namespace std;

int X[] = {0, 1, 0, -1};

int Y[] = {-1, 0, 1, 0};

int rows,coloums;

long long  gcd(long long  a, long long b)

{

    if (b == 0)

        return a;

    return gcd(b, a % b);

}



int main()

{

    fast;

    ll n,m;

    cin>>n>>m;

    

    ll x = (n*(n-1))/2;

    ll y = (m*(m-1))/2;

    cout<<(x+y)<<endl;

    

}


// Faster C++ solution for the same problem (measured speedup: 5.326351399764886x):
# include <stdio.h>

 

int main(){

	int N,M;

	scanf("%d %d",&N,&M);

	printf("%d\n",N*(N-1)/2+M*(M-1)/2);

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;



int main(){

	ios::sync_with_stdio(0);cin.tie(NULL);

	

	int n,m; cin>>n>>m;

	cout<<(n)*(n-1)/2+(m)*(m-1)/2<<endl;

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.329800063082648x):
# include <stdio.h>

 

int main(){

	int N,M;

	scanf("%d %d",&N,&M);

	printf("%d\n",N*(N-1)/2+M*(M-1)/2);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long Long;



int main(){

	ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

	Long n,m;cin>>n>>m; 

	Long resp=0;

	resp=(n*(n-1))/2+((m)*(m-1))/2,

	cout<<resp;

}

// Faster C++ solution for the same problem (measured speedup: 5.321731758550083x):
# include <stdio.h>

 

int main(){

	int N,M;

	scanf("%d %d",&N,&M);

	printf("%d\n",N*(N-1)/2+M*(M-1)/2);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define ll long long

const int N = 300005;



int n, m , ans;



int main()

{

    cin >> n >> m;

    ans = (n+m)*(n+m-1);

    ans/=2;

    ans-= (n*m);



    cout << ans;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.250956937573321x):
# include <stdio.h>

 

int main(){

	int N,M;

	scanf("%d %d",&N,&M);

	printf("%d\n",N*(N-1)/2+M*(M-1)/2);

	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

int n,a,b,c;

cin>>a>>b;

cout<<((a*(a-1))/2)+((b*(b-1))/2)<<endl;

return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.259069601428778x):
# include <stdio.h>

 

int main(){

	int N,M;

	scanf("%d %d",&N,&M);

	printf("%d\n",N*(N-1)/2+M*(M-1)/2);

	return 0;

}
// Slower C++ solution:
/*

 Abu Jafor Mohammad Saleh

 ios_base :: sync_with_stdio(false);

 cin.tie(NULL);

 

 */



#include<cstdio>

#include<iomanip>

#include<sstream>

#include<cstdlib>

#include<cctype>

#include<cmath>

#include<algorithm>

#include<set>

#include<queue>

#include<deque>

#include<stack>

#include<list>

#include<iostream>

#include<fstream>

#include<numeric>

#include<string>

#include<vector>

#include<cstring>

#include<map>

#include<iterator>

#include<limits>

#include <algorithm>

#include <unordered_map>

#include<fstream>

#define f first

#define s second

#define MOD 1000003



#define INF (int)1e9

#define PI 3.1415926535897932384626433832795

#define BOUNDARY(i, j) ((i >= 0 && i < rows) && (j >= 0 && j < coloums))



//#include<bits/stdc++.h>

#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long

const int maxn = 100001;

using namespace std;

int X[] = {0, 1, 0, -1};

int Y[] = {-1, 0, 1, 0};

int rows,coloums;

long long  gcd(long long  a, long long b)

{

    if (b == 0)

        return a;

    return gcd(b, a % b);

}



int main()

{

    fast;

    ll n,m;

    cin>>n>>m;

    

    ll x = (n*(n-1))/2;

    ll y = (m*(m-1))/2;

    cout<<(x+y)<<endl;

    

}


// Faster C++ solution for the same problem (measured speedup: 5.33572798220324x):
#include<stdio.h>

int main()

{

	int N,M,total1,total2;

	scanf("%d %d", &N, &M);

	total1=(N-1)*(N)/2;

	total2=(M-1)*(M)/2;

	printf("%d", total1+total2);

return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;



int main(){

	ios::sync_with_stdio(0);cin.tie(NULL);

	

	int n,m; cin>>n>>m;

	cout<<(n)*(n-1)/2+(m)*(m-1)/2<<endl;

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.339182716595453x):
#include<stdio.h>

int main()

{

	int N,M,total1,total2;

	scanf("%d %d", &N, &M);

	total1=(N-1)*(N)/2;

	total2=(M-1)*(M)/2;

	printf("%d", total1+total2);

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long Long;



int main(){

	ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

	Long n,m;cin>>n>>m; 

	Long resp=0;

	resp=(n*(n-1))/2+((m)*(m-1))/2,

	cout<<resp;

}

// Faster C++ solution for the same problem (measured speedup: 5.331100208508351x):
#include<stdio.h>

int main()

{

	int N,M,total1,total2;

	scanf("%d %d", &N, &M);

	total1=(N-1)*(N)/2;

	total2=(M-1)*(M)/2;

	printf("%d", total1+total2);

return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



#define ll long long

const int N = 300005;



int n, m , ans;



int main()

{

    cin >> n >> m;

    ans = (n+m)*(n+m-1);

    ans/=2;

    ans-= (n*m);



    cout << ans;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.260200794560972x):
#include<stdio.h>

int main()

{

	int N,M,total1,total2;

	scanf("%d %d", &N, &M);

	total1=(N-1)*(N)/2;

	total2=(M-1)*(M)/2;

	printf("%d", total1+total2);

return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int main()

{

int n,a,b,c;

cin>>a>>b;

cout<<((a*(a-1))/2)+((b*(b-1))/2)<<endl;

return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.268327740061729x):
#include<stdio.h>

int main()

{

	int N,M,total1,total2;

	scanf("%d %d", &N, &M);

	total1=(N-1)*(N)/2;

	total2=(M-1)*(M)/2;

	printf("%d", total1+total2);

return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

/*

#define mod 7

typedef long long ll;



ll fact[1000006], inv[1000006];



ll fp(ll base, ll exp)

{

    if (exp == 0)

        return 1;

    ll ans = fp(base, exp / 2);

    ans = (ans * ans) % mod;

    if (exp % 2 != 0)

        ans = (ans * (base % mod)) % mod;

    return ans;

}



void calcFacAndInv(ll n)

{

    fact[0] = inv[0] = 1;

    for (ll i = 1; i <= n; i++)

    {

        fact[i] = (i * fact[i - 1]) % mod;

        inv[i] = fp(fact[i], mod - 2);

    }

}



ll ncr(ll n, ll r)

{

    return ((fact[n] * inv[r]) % mod * inv[n - r]) % mod;

}



ll npr(ll n, ll r)

{

    return (fact[n] * inv[n - r]) % mod;

}



int main()

{

    calcFacAndInv(100000);

     cout<<inv[3];

    return 0;

}

*/





// GCD



int gcd(long long a,long long b)

{

    if (b==0)

        return a;

    return gcd (b,a%b);

}

//prime factoriation

/*

set<int >s;

bool prime factorization (int x)

{

    for (int j=2; j*j<=x; ++j)

    {

        while (x%j==0)

        {

            s.insert(j);

            x/=j;

        }

    }

    if (x>1)

    {

        s.insert(x);

    }

    if (s.size()==2)

        return true ;

    else

        return false ;

}



#define ll long long

int a,b,q,p,n;

int countDivisorss(int x,int y)

{

    ll cnt = 0;

    for (int i = min(x,y); i <= sqrt(n); i++)

    {

        if (x % i == 0&&y%i==0)

        {

            if (x / i == i||y / i == i)

                cnt++;



            else

                cnt = cnt + 2;

        }

    }

    return cnt;

}

int countDivisors(int x)

{

    ll cnt = 0;

    int tmp=n;

    if (n-x>10000000)  tmp=sqrt(n);

    for (int i = x; i <= tmp; i++)

    {

        if (x % i == 0)

        {

         if (x/i==i)

            cnt++;

         else

            cnt = cnt + 2;

        }

    }

    return cnt;

}

*/



/*

        int s =n/2,e=n-1;

        while (s<=e&&e<=n-1)

        {

            int mid =s+e/2;



            if (arr[mid]==arr[n/2])

            {

                s=mid;

                num +=mid -s;

            }

            else

                e=mid-1;

        }

        */









const int N = 1e5 + 5;



vector<int> adj[N];

bool visited[N];

int nodesNum;

void dfs(int node)

{

   if (visited[node])

       return;

   visited[node] = true;

   for (int child: adj[node])

       dfs(child);

}



//fast power

/*

#define mod 1000000007

long long fp(long long  base, long long exp)

{

    if (exp == 0)

        return 1;

    long long  ans = fp(base, exp / 2);

    ans = (ans * ans);

    if (exp % 2 != 0)

        ans = (ans * (base )) ;

    return ans;

}

*/



int main()

{

   long long n,m;

   cin>>n>>m;

   long long  a=(n*(n-1))/(2);

   long long  b=(m*(m-1))/(2);

   long long      ans =(a+b);

    cout<<ans;

   return 0;

}






// Faster C++ solution for the same problem (measured speedup: 18.540466913717246x):
#include <stdio.h>

int main(){

    int n,m;

    scanf("%d %d",&n,&m);

    printf("%d\n",n*(n-1)/2+m*(m-1)/2);

}
// Slower C++ solution:
#pragma GCC optimize ("O3")

#pragma GCC optimize ("unroll-loops")

#pragma GCC optimize("-Ofast")

#include <bits/stdc++.h>

using namespace std;



typedef int in;

#define int long long

#define f first

#define s second

#define pb push_back

#define pp push

#define RETURN exit(0)

#define pow(x,y) (int)(pow(x,y))

#define ceil(x) (int)(ceil(x))

#ifndef ONLINE_JUDGE

#define debug(x) cout<<x<<endl;

#else

#define debug(x) 42

#endif

const int MAX=1e4;

const int MOD=1e9+7;

const int MAAX=1e15;

const long double EPS=1e-6;

const int N=1e6;

int power(int x,int y)

{

    if (y == 0)

        return 1;

    int a=power(x,y/2);

    if (y % 2 == 0)

        return a * a % MOD;

    else

        return x * a * a % MOD;

}

long double sq(int x){

    long double s=0,e=x,mid;

    while(e-s>=EPS){

        mid=(s+e)/2;

        if(mid*mid<=x){

            s=mid;

        }

        else{

            e=mid-EPS;

        }

    }

    return s;

}

bool check(int x){



}

int binary(int x,int y){

    int s=x,e=y,mid;

    while(s<e){

        mid=ceil((s+e)/2.0);

        if(check(mid))

            s=mid;

        else

            e=mid-1;

    }

    return s;

}

vector<int> primes;

bool visted[N+5];

void sieve(){

    visted[0]=visted[1]=1;

    for(int i=2;i*i<=N;i++){

        if(visted[i]==0){

            primes.pb(i);

            for(int j=i*i;j<=N;j+=i){

                visted[j]=1;

            }

        }

    }

    for(int i=sqrt(N)+1;i<=N;i++){

        if(visted[i]==0)

            primes.pb(i);

    }

    return;

}







in main()

{

    //freopen("in.in","r",stdin);

    //freopen("out.out","w",stdout);

    int tc=1;

    //sieve();

    //scanf("%lld",&tc);

    while(tc--)

    {

        int n,m;

        cin>>n>>m;

        cout<<n*(n-1)/2+m*(m-1)/2<<endl;

    }

    RETURN;

}


// Faster C++ solution for the same problem (measured speedup: 5.256033464551087x):
#include <stdio.h>

int main(){

    int n,m;

    scanf("%d %d",&n,&m);

    printf("%d\n",n*(n-1)/2+m*(m-1)/2);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

/*

#define mod 7

typedef long long ll;



ll fact[1000006], inv[1000006];



ll fp(ll base, ll exp)

{

    if (exp == 0)

        return 1;

    ll ans = fp(base, exp / 2);

    ans = (ans * ans) % mod;

    if (exp % 2 != 0)

        ans = (ans * (base % mod)) % mod;

    return ans;

}



void calcFacAndInv(ll n)

{

    fact[0] = inv[0] = 1;

    for (ll i = 1; i <= n; i++)

    {

        fact[i] = (i * fact[i - 1]) % mod;

        inv[i] = fp(fact[i], mod - 2);

    }

}



ll ncr(ll n, ll r)

{

    return ((fact[n] * inv[r]) % mod * inv[n - r]) % mod;

}



ll npr(ll n, ll r)

{

    return (fact[n] * inv[n - r]) % mod;

}



int main()

{

    calcFacAndInv(100000);

     cout<<inv[3];

    return 0;

}

*/





// GCD



int gcd(long long a,long long b)

{

    if (b==0)

        return a;

    return gcd (b,a%b);

}

//prime factoriation

/*

set<int >s;

bool prime factorization (int x)

{

    for (int j=2; j*j<=x; ++j)

    {

        while (x%j==0)

        {

            s.insert(j);

            x/=j;

        }

    }

    if (x>1)

    {

        s.insert(x);

    }

    if (s.size()==2)

        return true ;

    else

        return false ;

}



#define ll long long

int a,b,q,p,n;

int countDivisorss(int x,int y)

{

    ll cnt = 0;

    for (int i = min(x,y); i <= sqrt(n); i++)

    {

        if (x % i == 0&&y%i==0)

        {

            if (x / i == i||y / i == i)

                cnt++;



            else

                cnt = cnt + 2;

        }

    }

    return cnt;

}

int countDivisors(int x)

{

    ll cnt = 0;

    int tmp=n;

    if (n-x>10000000)  tmp=sqrt(n);

    for (int i = x; i <= tmp; i++)

    {

        if (x % i == 0)

        {

         if (x/i==i)

            cnt++;

         else

            cnt = cnt + 2;

        }

    }

    return cnt;

}

*/



/*

        int s =n/2,e=n-1;

        while (s<=e&&e<=n-1)

        {

            int mid =s+e/2;



            if (arr[mid]==arr[n/2])

            {

                s=mid;

                num +=mid -s;

            }

            else

                e=mid-1;

        }

        */









const int N = 1e5 + 5;



vector<int> adj[N];

bool visited[N];

int nodesNum;

void dfs(int node)

{

   if (visited[node])

       return;

   visited[node] = true;

   for (int child: adj[node])

       dfs(child);

}



//fast power

/*

#define mod 1000000007

long long fp(long long  base, long long exp)

{

    if (exp == 0)

        return 1;

    long long  ans = fp(base, exp / 2);

    ans = (ans * ans);

    if (exp % 2 != 0)

        ans = (ans * (base )) ;

    return ans;

}

*/



int main()

{

   long long n,m;

   cin>>n>>m;

   long long  a=(n*(n-1))/(2);

   long long  b=(m*(m-1))/(2);

   long long      ans =(a+b);

    cout<<ans;

   return 0;

}






// Faster C++ solution for the same problem (measured speedup: 18.540466913717246x):
#include <stdio.h>



int main (){

	

	int n,m,a,b;

	

	scanf("%d %d",&n,&m);

	

	a=(n*(n-1))/2;

	b=(m*(m-1))/2;	

	

	printf("%d\n",a+b);







return 0;

}
// Slower C++ solution:
#pragma GCC optimize ("O3")

#pragma GCC optimize ("unroll-loops")

#pragma GCC optimize("-Ofast")

#include <bits/stdc++.h>

using namespace std;



typedef int in;

#define int long long

#define f first

#define s second

#define pb push_back

#define pp push

#define RETURN exit(0)

#define pow(x,y) (int)(pow(x,y))

#define ceil(x) (int)(ceil(x))

#ifndef ONLINE_JUDGE

#define debug(x) cout<<x<<endl;

#else

#define debug(x) 42

#endif

const int MAX=1e4;

const int MOD=1e9+7;

const int MAAX=1e15;

const long double EPS=1e-6;

const int N=1e6;

int power(int x,int y)

{

    if (y == 0)

        return 1;

    int a=power(x,y/2);

    if (y % 2 == 0)

        return a * a % MOD;

    else

        return x * a * a % MOD;

}

long double sq(int x){

    long double s=0,e=x,mid;

    while(e-s>=EPS){

        mid=(s+e)/2;

        if(mid*mid<=x){

            s=mid;

        }

        else{

            e=mid-EPS;

        }

    }

    return s;

}

bool check(int x){



}

int binary(int x,int y){

    int s=x,e=y,mid;

    while(s<e){

        mid=ceil((s+e)/2.0);

        if(check(mid))

            s=mid;

        else

            e=mid-1;

    }

    return s;

}

vector<int> primes;

bool visted[N+5];

void sieve(){

    visted[0]=visted[1]=1;

    for(int i=2;i*i<=N;i++){

        if(visted[i]==0){

            primes.pb(i);

            for(int j=i*i;j<=N;j+=i){

                visted[j]=1;

            }

        }

    }

    for(int i=sqrt(N)+1;i<=N;i++){

        if(visted[i]==0)

            primes.pb(i);

    }

    return;

}







in main()

{

    //freopen("in.in","r",stdin);

    //freopen("out.out","w",stdout);

    int tc=1;

    //sieve();

    //scanf("%lld",&tc);

    while(tc--)

    {

        int n,m;

        cin>>n>>m;

        cout<<n*(n-1)/2+m*(m-1)/2<<endl;

    }

    RETURN;

}


// Faster C++ solution for the same problem (measured speedup: 5.256033464551087x):
#include <stdio.h>



int main (){

	

	int n,m,a,b;

	

	scanf("%d %d",&n,&m);

	

	a=(n*(n-1))/2;

	b=(m*(m-1))/2;	

	

	printf("%d\n",a+b);







return 0;

}