stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <iostream>

#include <string>

#include <map>



using namespace std;



map<string, int>mymap;

int main() {

	int N;

	cin >> N;

	mymap["AC"] = 0;

	mymap["WA"] = 0;

	mymap["TLE"] = 0;

	mymap["RE"] = 0;

	for (int i = 0; i < N; i++) {

		string s;

		cin >> s;

		mymap[s]++;

	}

	cout << "AC" << " x " << mymap["AC"] << endl;

	cout << "WA" << " x " << mymap["WA"] << endl;

	cout << "TLE" << " x " << mymap["TLE"] << endl;

	cout << "RE" << " x " << mymap["RE"] << endl;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



using namespace std;

int main() {

    int n;

    string value;

    int c[4] = {0,0,0,0};

    cin>> n;

    while(n){

        cin>> value;

        if(value == "AC")

            c[0]+= 1;

        else if(value == "WA")

            c[1]+= 1;

        else if(value == "TLE")

            c[2]+= 1;

        else

            c[3]+= 1;

        n--;

    }

    cout<< "AC x "<< c[0] <<"\nWA x "<< c[1] <<"\nTLE x "<< c[2] << "\nRE x "<< c[3];

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <bits/stdc++.h>

#include<sstream>

using namespace std;

const int N = 1e5 + 7, M = 1e7, OO = 0x3f3f3f3f;

#define endl '\n'

#define  ll long long

#define loop(i,n) for(int i = 0;i < int(n);++i)

#define rloop(i,n) for(int i = int(n);i >= 0;--i)

#define range(i,a,b) for(int i = int(a);i <= int(b);i++)

#define p(a) printf("%d ",a)

#define S(n) scanf("%d",&n)

int main () {

    map<string,int>mp;

    mp["AC"]=0;

    mp["WA"]=0;

    mp["TLE"]=0;

    mp["RE"]=0;

    int n;S(n);

    string s;

    loop(i,n) {

        cin >> s;

        mp[s]++;

    }

    printf("AC x %d\n",mp["AC"]);

    printf("WA x %d\n",mp["WA"]);

    printf("TLE x %d\n",mp["TLE"]);

    printf("RE x %d\n",mp["RE"]);



    return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include<vector>

#include<map>

#include<set>

#include<string>

#include<algorithm>

#include<math.h>

#include<bits/stdc++.h>

#include<cmath>

#include<iomanip>

using namespace std;



const double PI  =3.141592653589793238463;

#define pb push_back

#define pf push_front

#define sz(v)  ((int)(v).size());

#define all(v) ((v).begin()),((v).end())

typedef unsigned long long ull;

typedef long long ll;



typedef vector<int> vi;

typedef pair<int,int> pi;

//2 7 3 4 9



void printVec(vi v1)

{

    for(int i=0; i<v1.size(); i++)

        cout<<v1[i]<<" ";

    cout<<endl;

}

int main()

{

    ios::sync_with_stdio(false);

    cout.tie(NULL);

    cin.tie(NULL);





   long long AC=0,WA=0,TLE=0,RE=0;



long long t;cin>>t;

string s;

while(t--){

        cin>>s;

    if(s=="AC"){

        AC++;

    }else if(s=="WA"){

    WA++;

    }else if(s=="TLE"){

    TLE++;

    }else{

    RE++;}

}

cout<<"AC x "<<AC<<endl;

cout<<"WA x "<<WA<<endl;

cout<<"TLE x "<<TLE<<endl;

cout<<"RE x "<<RE<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include<bits/stdc++.h>

#define input ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define ll long long

#define ull unsigned long long

#define ii pair<int,int>

#define dl endl

#define ft first

#define sc second

using namespace std;

int n, a[4];

string s;

int main()

{

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

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

	input;

	cin >> n;

	while (n--)

	{

		cin >> s;

		if (s == "AC")a[0]++;

		else if (s == "WA")a[1]++;

		else if (s == "TLE")a[2]++;

		else a[3]++;

	}

	cout << "AC x " << a[0]<<dl;

	cout << "WA x " << a[1] << dl;

	cout << "TLE x " << a[2] << dl;

	cout << "RE x " << a[3] << dl;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <set>

#include <string>



using namespace std;



int main() {

    int n; cin >> n;

    string temp;

    int ac = 0, wa = 0, tle = 0, re = 0;

    for(int i = 0; i < n; i++) {

        cin >> temp;

        if(temp == "AC") ac++;

        else if(temp == "WA") wa++;

        else if(temp == "TLE") tle++;

        else if(temp == "RE") re++;

    }

    cout << "AC x " << ac << "\n"

        << "WA x " << wa << "\n"

        << "TLE x " << tle << "\n"

        << "RE x " << re << "\n";

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main(){

    int c1=0,c2=0,c3=0,c4=0,x;

    string s;

    cin>>x;

    for(int i=0;i<x;i++){

        cin>>s;

        if(s=="AC"){

            c1++;

        }

        else if(s=="WA")

            c2++;

        else if (s=="TLE")

            c3++;

        else if(s=="RE")

            c4++;

        

    }



    cout<<"AC x "<<c1<<endl;

    cout<<"WA x "<<c2<<endl;

    cout<<"TLE x "<<c3<<endl;

    cout<<"RE x "<<c4<<endl;







    return 0;



}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

using namespace std;

int main()

{

	int n,AC=0,TLE=0,WA=0,RE=0;

	string test;

	cin>>n;

	for (int i=0;i<n;i++)

	{

		cin>>test;

		if (test=="AC")

			AC++;

		else if (test=="TLE")

			TLE++;

		else if (test=="WA")

			WA++;

		else if (test=="RE")

			RE++;

	}

	cout<<"AC x "<<AC<<endl;

	cout<<"WA x "<<WA<<endl;

	cout<<"TLE x "<<TLE<<endl;

	cout<<"RE x "<<RE<<endl;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

typedef long long ll;

#define dbg(x) cout<<#x<<" = "<<x<<endl

#define dbg2(x,y) cout<<#x<<" = "<<x<<", "<<#y<<" = "<<y<<endl

#define dbg3(x,y,z) cout<<#x<<" = "<<x<<", "<<#y<<" = "<<y<<", "<<#z<<" = "<<z<<endl

#define dbg4(x,y,z,q) cout<<#x<<" = "<<x<<", "<<#y<<" = "<<y<<", "<<#z<<" = "<<z<<", "<<#q<<" = "<<q<<endl

#define dbg_array(x,sz) for (int i = 0; i < sz; ++i) cout << x[i] << " \n"[i==sz-1]

using namespace std;



const ll N = 100 + 9, M = 400 - 9, Max_ans = 1LL * (1e16);

int vis[N];



int main() {

	ios_base::sync_with_stdio(0), cin.tie(0);

#ifdef ECLIPSE

	freopen("input.in", "rt", stdin);

	//freopen("output.out", "wt", stdout);

#endif

	int n;

	cin >> n;

	string s;

	while (n--) {

		cin >> s;

		++vis[s[0] - 'A'];

	}

	printf("AC x %d\n", vis['A' - 'A']);

	printf("WA x %d\n", vis['W' - 'A']);

	printf("TLE x %d\n", vis['T' - 'A']);

	printf("RE x %d\n", vis['R' - 'A']);

	return 0;

}




// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <map>

#include <string>

using namespace std;



int main()

{

	map<string, int> test;

	int count = 0;

	string verdict;

	cin >> count;

	for (int i = 0; i < count; i++)

	{

		test["AC"] = 0;

		

		test["WA"] = 0;

		

		test["TLE"] = 0;



		test["RE"] = 0;

	}



	for (int i = 0; i < count; i++)

	{

		cin >> verdict;

		

		if (verdict == "AC")

			test["AC"]++;

		else if (verdict == "WA")

			test["WA"]++;

		else if (verdict == "TLE")

			test["TLE"]++;

		else if (verdict == "RE")

			test["RE"]++;

	}

	cout << "AC"<< " x " << test["AC"] << endl;

	cout << "WA" << " x "<< test["WA"] << endl;

	cout << "TLE" << " x " << test["TLE"] << endl;

	cout << "RE" << " x " << test["RE"] << endl;

	return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define ll long long



bool cmp(const pair<string, int>&i, const pair<string, int>&j)

{

    return i.second > j.second;

}







int main() {

            int AC = 0 , WA= 0 , TLE =0 , RE=0;

            int n ; cin >> n ;  string s ;

             for ( int i = 0 ; i < n ; i ++ ) {

                  cin >> s;

                   if ( s == "AC")

                       AC++;

                   else if ( s == "TLE")

                       TLE++;

                   else if ( s == "WA")

                       WA++;

                   else

                       RE++;

             }



        cout << "AC x "<<AC<<endl;

        cout << "WA x "<<WA<<endl;

        cout << "TLE x "<<TLE<<endl;

        cout << "RE x "<<RE<<endl;

    

        return 0;

    }

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<string>

using namespace std;

int main(){

	int t, c0 = 0, c1 = 0, c2 = 0, c3  = 0;

	cin>>t;

	string test;

	while(t--){

		cin>>test;

		if(test == "AC")

		   c0++;

		else if(test == "WA")

		   c1++;

		else if(test == "TLE")

		   c2++;

		else if(test == "RE")

		   c3++;

	}

	cout<<"AC"<<" x "<<c0<<endl;

	cout<<"WA"<<" x "<<c1<<endl;

	cout<<"TLE"<<" x "<<c2<<endl;

	cout<<"RE"<<" x "<<c3<<endl;

	

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>



using namespace std;



int main()

{

    int N;

    cin>>N;



    int AC=0,WA=0,TLE=0,RE=0;

    string s;



    while(N--)

    {

        cin>>s;



        if(s.compare("AC")==0)

            AC++;



        if(s.compare("WA")==0)

            WA++;



        if(s.compare("TLE")==0)

            TLE++;



        if(s.compare( "RE")==0)

            RE++;





    }



    cout<<"AC x "<<AC<<"\n";

    cout<<"WA x "<<WA<<"\n";

    cout<<"TLE x "<<TLE<<"\n";

    cout<<"RE x "<<RE<<"\n";

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdio>

#include<map>

using namespace std;

int main(void)

{

    ios::sync_with_stdio(false);

    map<string,int> mp;

    int n;

    char ch[10];

    while(cin>>n)

    {

        for(int i=0;i<n;++i)

        cin>>ch,mp[ch]++;

        printf("AC x %d\n",mp["AC"]);

        printf("WA x %d\n",mp["WA"]);

        printf("TLE x %d\n",mp["TLE"]);    

        printf("RE x %d\n",mp["RE"]);

    }

    return 0;

} 

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	long int Zx = 0, Xy = 0, Yz = 0, xyz = 0, count;

	scanf("%ld", &count);

	for (int u = 0; u < count; u++) {

		char kata[5];

		scanf("%s", &kata);

		switch (kata[0]) {

			case 'A':

				Zx++;

				break;

			case 'W':

				Xy++;

				break;

			case 'T':

				Yz++;

				break;

			case 'R':

				xyz++;

				break;		

		}	

	}

	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n", Zx, Xy, Yz, xyz);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

    long long int a,b,j,k;

    cin >> a >> b;

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

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

    cout << j+k << endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int N, M, hasil1,hasil2 ;

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

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

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

    printf("%d", hasil1+hasil2);

return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define FLASH ios_base::sync_with_stdio(0);

#define ll long long

#define debt(x,y)cout<<"#x = "<<(x)<<" and "<<"#y = "<<(y)<<endl;

#define deb(x)cout<<"#x = "<<(x)<<endl;

#define pb push_back

#define mp make_pair

#define all(x) (x).begin(), (x).end()

#define endl "\n"

#define arr(a,n) for(ll i=1;i<=n;i++) cout<<a[i]<<" "; cout << "\n";

#define vecc(a,n) for(ll i=0;i<n;i++) cout<<a[i]<<" "; cout << "\n";





using namespace std;



ll a,b;



int main(){

FLASH;

cin>>a>>b;

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















return 0;

} 


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int N, M, hasil1,hasil2 ;

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

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

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

    printf("%d", hasil1+hasil2);

return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

    int a,b;

    cin>>a>>b;

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

return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

    int N, M, hasil1,hasil2 ;

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

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

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

    printf("%d", hasil1+hasil2);

return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main() {

  int n, m;

  cin >> n >> m;

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

}

// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main() {

  int n, m;

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

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main() {

  int n, m;

  cin >> n >> m;

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

}


// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main() {

  int n, m;

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

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main() {

  int n, m;

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

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

}


// Optimized solution to the same problem (faster):
#include<cstdio>

using namespace std;

int main() {

  int n, m;

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

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

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include <vector>

using namespace std;

int main()

{

 int n,m;

 cin>>n>>m;

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

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int N;

	int M;

	int total;

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

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

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

	total= N + M;

	printf("%d",total);

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;

int main()

{

	long long int n,m;

	cin>>n>>m;

	n--;

	m--;

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

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int main()

{

	int N;

	int M;

	int total;

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

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

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

	total= N + M;

	printf("%d",total);

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)

#define REPD(i,n) for(ll i=n-1;i>=0;i--)

#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)

#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define ALL(x) (x).begin(),(x).end() 

#define SIZE(x) ((ll)(x).size())

#define MAX(x) *max_element(ALL(x))

#define MIN(x) *min_element(ALL(x))

#define INF 1000000000

using namespace std;

typedef long long ll;



const ll M = 998244353;

vector<ll> fac(300001);

vector<ll> ifac(300001);



int Combination(int n, int r){

        int num = 1;

        for(int i = 1; i <= r; i++){

            num = num * (n - i + 1) / i;

        }

        return num;

    }



int main(void)

{

    int N, M;

    cin >> N >> M;

    

    int ans = 0;

    ans += Combination(N, 2);

    ans += Combination(M, 2);





    cout << ans << endl;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)

#define REPD(i,n) for(ll i=n-1;i>=0;i--)

#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)

#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define ALL(x) (x).begin(),(x).end() 

#define SIZE(x) ((ll)(x).size())

#define MAX(x) *max_element(ALL(x))

#define MIN(x) *min_element(ALL(x))

#define INF 1000000000

using namespace std;

typedef long long ll;





int comb(int n, int r){

    int num = 1;

    FOR(i, 1, r){

        num = num * (n - i + 1)/i;

    }



    return num; 

}



int main() {

    int N, M;

    cin >> N >> M;



    int ans = comb(N, 2) + comb(M, 2);



    cout << ans << endl;



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/*

 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;

    

}


// Optimized solution to the same problem (faster):
#include <stdio.h>



int main(){

	int even;

	int odd;

	int ans = 0;

	scanf("%d %d", &even, &odd);

	int ans1 = even * (even - 1)/2;

	int ans2 = odd * (odd - 1)/2;

	

	printf("%d", ans1 + ans2);

	return 0;

}

// Fastest known solution for this problem: