#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
	freopen("employ.in","r",stdin);
	freopen("employ.out","w",stdout);
	int n,m;
	string s;
	cin>>n>>m;
	cin>>s;
	cout<<n*(n-1)/2;
	return 0;
}
