#include using namespace std; int main() { int a; cin >> a; int answer = a * (a - 1) /2; cout << answer << "\n"; }