Problem:
 Score : 400 points    Problem Statement For an integer N , we will choose a permutation \{P_1, P_2, ..., P_N\} of \{1, 2, ..., N\} .  Then, for each i=1,2,...,N , let M_i be the remainder when i is divided by P_i .  Find the maximum possible value of M_1 + M_2 + \cdots + M_N .      Constraints  N is an integer satisfying 1 \leq N \leq 10^9 .         Input Input is given from Standard Input in the following format:  N       Output Print the maximum possible value of M_1 + M_2 + \cdots + M_N .        Sample Input 1 2      Sample Output 1 1  When the permutation \{P_1, P_2\} = \{2, 1\} is chosen, M_1 + M_2 = 1 + 0 = 1 .       Sample Input 2 13      Sample Output 2 78       Sample Input 3 1      Sample Output 3 0

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce


import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n = I()
print(int(n*(n-1)//2))

Solution (Python):
N = int(input())
ans = (N*(N-1))//2
print(ans)

Solution (Python):
n = int(input())

ans=0
if (n-1)%2==0:
    ans+=n*((n-1)//2)
else:
    ans+=n*((n-1)//2)+n//2
print(ans)

Solution (Python):
def main():
    n = int(input())
    ans = 0
    ans += n * (n - 1) // 2
    print(int(ans))

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N = INT()
print(N*(N-1)//2)

Solution (Python):
n = int(input())
print(int(n * (n - 1) // 2))

Solution (Python):


N = int(input())
print(N * (N - 1) // 2)

Solution (Python):
N=int(input())
print(int(N*(N-1)//2))

Solution (Python):
N = int(input())

print(N * (N - 1) // 2)

Solution (Python):
import math

n = int(input())

_sum = (n**2 + n) // 2

print(_sum - n)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):




import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n=int(readline())

    ans=(n * (n-1)) // 2
    
    print(ans)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

Solution (Python):
N = int( input() )
print( N * ( N - 1 ) // 2 )

Solution (Python):
n=int(input())
print((n-1)*n//2)

Solution (Python):
N=int(input())

print(  N*( N-1 )//2  )

Solution (Python):
def main():
    N = int(input())
    res = N*(N-1)//2
    print(res)
    
main()

Solution (Python):
import sys, heapq

N = int(input())

res = (N - 1) * N // 2
print(res)

Solution (Python):
k = int(input())
print(k*(k-1)//2)

Solution (Python):
N = int(input())

if N % 2 == 0:
    N = N // 2
    print(N*(2*N-1))
else:
    N = N // 2 
    print(N*(2*N+1))

Solution (Python):
n = int(input())
ans = n*(n-1)//2
print(ans)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    N = I()

    print(N*(N-1)//2)

if __name__ == '__main__':
    resolve()

Solution (Python):
n = int(input())

ans = n*(n-1)//2
print(ans)

Solution (Python):
n = int(input())
print(int(n*(n-1)//2))

Solution (Python):
n=int(input())-1
print((1+n)*n//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
import sys













ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    n = ni()
    ans = ((n-1)*n)//2
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N = int(input())
    print(N * (N - 1) // 2)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
ans = n*(n-1)//2
print(ans)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
import sys
from io import StringIO
import unittest

def resolve():
    n = int(input())

    ans = n * (n - 1) // 2
    print(int(ans))

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """2"""
        output = """1"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """13"""
        output = """78"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """1"""
        output = """0"""
        self.assertIO(input, output)

if __name__ == "__main__":
    
    resolve()

Solution (Python):
from sys import stdin
import math
import fractions
import heapq

n = int(stdin.readline().rstrip())

cnt = n * (n-1) // 2

print(cnt)

Solution (Python):
N = int(input())

print(N*(N-1)//2)

Solution (Python):
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N = int(readline())

    print(N * (N - 1) // 2)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
    
print((N - 1) * N // 2)

Solution (Python):
n=int(input())
if n==1:
  print(0)
else:
  print(n*(n-1)//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())

print(N*(N-1)//2)

Solution (Python):
import math
n = int(input())
dum1 = (n-1 + 1) * ((n-1)//2)
if (n-1) % 2 == 0:
    print(dum1)
else:
    print(dum1+math.ceil((n-1)/2))

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
N = int(input())

if N % 2 == 0:
    result = N // 2
    result = result * (N - 1)
elif N % 2 == 1:
    result = (N - 1) // 2
    result = result * N

print(result)

Solution (Python):
import math

def main(n):
    return int(n * (n-1) // 2)

n = int(input())
print(main(n))

Solution (Python):
N = int(input())

print(N*(N-1)//2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
n=int(input())
ans=(1+n)*n//2
print(ans-n)

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()

print(n*(n-1)//2)

Solution (Python):
N = int(input())

if N == 1:
    print(0)
else:
    print((N)*(N-1)//2)

Solution (Python):
def main():
    n = int(input())
    print(n*(n-1)//2)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
print((n-1)*n//2)

Solution (Python):
n = int(input())-1
print(n*(1+n)//2)

Solution (Python):
n = int(input())

print(n*(n-1)//2)

Solution (Python):
n=int(input())
print(n * (n-1)//2)

Solution (Python):
n=int(input())
sumNum=n*(n-1)//2
 

print(sumNum)

Solution (Python):
N = int(input())
print(int((N*(N-1))//2))

Solution (Python):
N = int(input())

print((N * (N - 1)) // 2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N * (N - 1) // 2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N=int(input())
print(str(N*(N-1)//2))

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N=int(input())
ans=N*(N-1)//2
print(ans)

Solution (Python):
n = int(input())
print((n*(n-1))//2)

Solution (Python):

N = int(input())
ans = N*(N-1)//2
print(ans)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
def q4():
    N = int(input())
    ans = N * (N-1) // 2
    print(ans)


if __name__ == '__main__':
    q4()

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
import sys
input = sys.stdin.readline


n = int(input())

if (n-1) % 2 == 0:
	ans = n * (n-1)//2
else:
	ans = (n-1) * n//2

print(ans)

Solution (Python):
N = int(input())
print(N * (N-1) // 2)

Solution (Python):



N = int(input())
print(N * (N - 1) // 2)
"""
P = [i + 1 for i in range(N)]

for v in itertools.permutations(P, N):
    val = 0
    for i in range(N):
        val += (i + 1) % v[i]
    if val == 78:
        print(v, val)
"""

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())

print((N-1)*N//2)

Solution (Python):
N = int(input())
s = N - 1
ans = s*(1+s)//2
print(ans)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
n=int(input())
ans=n*(n-1)//2
print(ans)

Solution (Python):
n = int(input())



print(n * (n - 1) // 2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print((N+1) * N // 2 - N)

Solution (Python):
n = int(input())
print(n * (n - 1) // 2)

Solution (Python):
n=int(input())
suu=n*(n-1)//2
print(suu)
w=[1,2,3,4]

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def lcm(x, y):
    return (x * y) // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def gcd_list(numbers):
    return reduce(gcd, numbers)


def is_prime(n):
    if n <= 1:
        return False
    p = 2
    while True:
        if p ** 2 > n:
            break
        if n % p == 0:
            return False
        p += 1
    return True



def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []

    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P


def permutation_with_duplicates(L):

    if L == []:
        return [[]]

    else:
        ret = []

        
        S = sorted(set(L))

        for i in S:

            data = L[:]
            data.remove(i)

            for j in permutation_with_duplicates(data):
                ret.append([i] + j)

        return ret



n = int(input())
ans = (n - 1) * n // 2
print(ans)

Solution (Python):
n = int(input())
print(sum(range(n)))

Solution (Python):
n = int(input())
if n % 2 == 1:
    print(n * (n // 2))
else:
    print((n * n - n) // 2)

Solution (Python):
n = int(input())
print(n *(n-1)//2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())

print(N*(N-1)//2)

Solution (Python):
n = int(input())
ans = (n-1)*n//2
print(ans)

Solution (Python):
n = int(input())
ans = (n-1)*n//2
print(ans)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
n = int(input())
print(n * (n + 1) // 2 - n)

Solution (Python):
n=int(input())
print((n-1)*n//2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
def main():
    n = int(input())
    print(n*(n-1)//2)

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
print((n - 1) * n // 2)

Solution (Python):
N = int(input())
N -= 1
print((N*(N+1))//2)

Solution (Python):
n = int(input())
print(n*(n+1)//2-n)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())

print((N-1)*N//2)

Solution (Python):
N = int(input())

print(N*(N-1)//2)

Solution (Python):
n=int(input())
print((n*(n-1))//2)

Solution (Python):

import sys


def solve(N: int):
    print(N*(N-1)//2)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    solve(N)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline().rstrip


def main():
    n = int(input())
    print(int(n * (n - 1) // 2))


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
print((N-1)*N//2)

Solution (Python):

N = int(input())


N_list_sum =N*(N+1)//2
ans =N_list_sum -N
print(ans)

Solution (Python):
n = int(input())
print(n * (n-1) // 2)

Solution (Python):
N = int(input())
ans = N*(N-1)//2
print(ans)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
def myAnswer(N:int) -> int:
   N -=1
   return N * (N + 1) // 2

def modelAnswer():
   return
def main():
   N = int(input())
   print(myAnswer(N))
if __name__ == '__main__':
   main()

Solution (Python):
N=int(input())
print(N*(N-1)//2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):

N = int(input())
print(int(N*(N-1))//2)

Solution (Python):
import os, sys, re, math

N = int(input())

s = (1 + (N - 1)) * (N // 2)
if (N - 1) % 2 == 1:
    s -= N // 2

print(s)

Solution (Python):
N = int(input())
ret = (1 + N) * N // 2 - N 


print(ret)

Solution (Python):
n = int(input())



print(n*(n-1)//2)

Solution (Python):
n = int(input())
print(n * (n - 1) // 2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N * (N-1) // 2)

Solution (Python):
n=int(input())
print((n*(n+1)//2)-n)

Solution (Python):
n = int(input())
print((n-1)*n // 2)

Solution (Python):
n = int(input())
ans = (n - 1) * n // 2
print(ans)

Solution (Python):
N = int(input())
print(N * (N - 1) // 2)

Solution (Python):
n = int(input())
print(n * (n + 1) // 2 - n)

Solution (Python):
N = int(input())
print((N*(N-1))//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
A = N*(N-1)//2
print(A)

Solution (Python):
n=int(input())
print(int((n-1)*n//2))

Solution (Python):
N=int(input())
print((N)*(N-1)//2)

Solution (Python):
N=int(input())
ans=N*(N-1)//2
print(ans)

Solution (Python):

data=int(input())
strs=(data*(data-1))//2
print(strs)

Solution (Python):
n = int(input())
print(n *(n - 1) // 2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N * (N - 1) // 2)

Solution (Python):
n = int(input())
ans=(n*(n-1))//2
print(int(ans))

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
n = int(input())
print((n*(n-1)//2))

Solution (Python):
N = int(input())
if N % 2 == 1:
    print(N * (N//2))
else:
    print(N * (N//2-1) + (N//2))

Solution (Python):
n = int(input())

m_sum = 0
print(int(n*(n-1)//2))

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):


n=int(input())

if n%2==0:
    a=int(n/2)
    print(a*(n-1))
else:
    a=int((n-1)/2)
    print(a*n)

Solution (Python):
n = int( input())
total = 0
if n ==1:
    print(0)
else:
    print((n*(n-1))//2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque

from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]



n=I()
ans=n*(n-1)//2
print(ans)

Solution (Python):
N=int(input())
ans=(1+(N-1))*(N-1)//2
print(ans)

Solution (Python):
n = int(input())
print((n*(n-1))//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N * (N - 1) // 2)

Solution (Python):
n = int(input())
print(n*~-n//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N * (N - 1) // 2)

Solution (Python):
n=int(input())




ans=(n*(n-1))//2

print(ans)

Solution (Python):
import math
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N = int(input())
  ans = 0
  if N==1:
    ans = 0
  else:
    ans = (N-1) * N//2
  print(ans)
  
if __name__ == '__main__':
  main()

Solution (Python):
N = int(input())
n = N - 1

ans = n * (n + 1) // 2
print(ans)

Solution (Python):
n = int(input())
x = (n - 1) * n // 2
print(x)

Solution (Python):
def resolve():
    n=int(input())
    print((n*(n-1))//2)
resolve()

Solution (Python):
'''Haha this is python? How could you tell, Sherlock?'''

n = int(input())
print((n * (n - 1)) // 2)

Solution (Python):
n=int(input())
print((n**2-n)//2)

Solution (Python):
n = int(input())

print(n*(n - 1)//2)

Solution (Python):
n = int(input())
print((n * (n - 1))  // 2)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1











N = int(input())
res = (N - 1) * N // 2
print(res)

Solution (Python):
n = int(input())
n -= 1
print(n*(n+1)//2)

Solution (Python):
n=int(input())
print((n*(n-1))//2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
n = int(input())


print((n-1)*(n)//2)

Solution (Python):


import sys
import math
import time

import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools








N = int(input())
ans = (N-1)*(N)//2
print(int(ans))

Solution (Python):
n = int(input())

print(n * (n-1)//2 )

Solution (Python):
N = int(input())
print(N * (N - 1) // 2)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    print(n*(n-1)//2)

if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    print(n*(n-1)//2)

if __name__=='__main__':
    main()

Solution (Python):
n = int(input())
ans = 0
if ((n-1)%2==0):
    ans = (n)*((n-1)//2)
else:
    ans = (n)*((n-1)//2) + n//2
print(ans)

Solution (Python):
m = int(input())
print(m*(m-1)//2)

Solution (Python):
N = int(input())
print(sum(range(0, N)))

Solution (Python):
n=int(input())
print((n*(n-1))//2)

Solution (Python):
n=int(input())
print(n * (n-1) // 2)

Solution (Python):
n=int(input())

ans = n*(n-1)//2

print(ans)

Solution (Python):
N = int(input())
print(N * (N - 1) // 2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
n = int(input())
print(n * (n - 1) // 2)

Solution (Python):
n = int(input())
if n == 1:
    print(0)
else:
    s = n * (n - 1) // 2 
    print(s)

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    t = (1 + n) * n // 2
    print(t - n)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
N = int(input())

def kaidan(k):
    return k * (k + 1) // 2

print(kaidan(N-1))

Solution (Python):
N=int(input())
print(N*(N-1)//2)

Solution (Python):
N = int(input())

print(N * (N - 1) // 2)

Solution (Python):
N=int(input())
print(N*(N-1)//2)

Solution (Python):
"""
int(input())
map(int,input().split())
list(map(int,input().split()))

"""
import math
n=int(input())
ans=n*(n-1)//2
print(ans)

Solution (Python):
n = int(input())

print(int(n * (n - 1) // 2))

Solution (Python):
n = int(input())

print(n*(n-1)//2)

Solution (Python):
N = int(input())
N -= 1
print((N*(N+1))//2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
N = int(input())
print((N*(N-1))//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):

n = int(input())

ans = n * (n-1) // 2
print(ans)

Solution (Python):
N = int(input())

ans = N * (N - 1) // 2

print(ans)

Solution (Python):
N = int(input())
print((N-1)*N//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
n=int(input());print(n*~-n//2)

Solution (Python):
def main():
    N = int(input())
    ans = (N - 1) * N // 2
    
    
    
    
    
    
    
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
n -= 1
print((n*n+n)//2)

Solution (Python):
n = int(input())
print((n-1)*n//2)

Solution (Python):
n = int(input())
print(int(n*(n-1)//2))

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())


def sigma(n):
    return n*(n+1)//2

print(sigma(n-1))

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n = I()
    print(n*(n-1)>>1)
    return


if __name__ == "__main__":
    solve()

Solution (Python):
n = int(input())
print(n * (n - 1) // 2)

Solution (Python):
n = int(input())
ans = n * (n + 1) // 2 - n
print(ans)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
def main():
    N = int(input())
    ans = (N-1)*N//2
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
n -= 1
print((n*n+n)//2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):



N=int(input())

print(N*(N-1)//2)

Solution (Python):
N = int(input())

print((N-1)*N // 2)

Solution (Python):
N = int(input())
print(N * (N - 1) // 2)

Solution (Python):

n = int(input())

su = n * (n + 1) // 2
print(su - n)

Solution (Python):
N = int(input())
n = N - 1
print(n * (n+1)//2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
N=int(input())
ans=N*(N-1)//2
print(ans)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
from sys import stdin,setrecursionlimit
import string
setrecursionlimit(10 ** 7)
n = int(stdin.readline().rstrip())
print(n*(n-1)//2)

Solution (Python):
from itertools import permutations
import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    n=II()
    print(n*(n-1)//2)

main()

Solution (Python):
n = int(input())
print((n+1)*n//2 - n)

Solution (Python):
N=int(input())
print((1+N-1)*(N-1)//2)

Solution (Python):
def main():
    n = int(input())
    print((n - 1) * n // 2)


if __name__ == '__main__':
    main()

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]
debugmode = False

n = INT()
ans = n * (n - 1) // 2
print(ans)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):

from collections import Counter
def inputlist(): return [int(k) for k in input().split()]

N = int(input())
print(N*(N-1)//2)

Solution (Python):
N = int(input())

print(sum(range(N)))

Solution (Python):
n = int(input())

print(n*(n-1)//2)

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
ans = 0
ans = (n-1) * (n) // 2

print(ans)

Solution (Python):
n = int(input())

print(n*(n-1)//2)

Solution (Python):
n = int(input())

print(n * (n-1) // 2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
import sys
stdin=sys.stdin

ns = lambda:stdin.readline().rstrip()
ni = lambda:int(stdin.readline().rstrip())
nm = lambda:map(int,stdin.readline().split())
nl = lambda:list(map(int,stdin.readline().split()))

N=int(input())
print((N*(N-1)//2))

Solution (Python):
N = int(input())
print(N * (N-1) // 2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
N = int(input())
print(int(N*(N-1)//2))

Solution (Python):
N=int(input())
print((N-1)*N//2)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
def sum1(n):
    return (n) * (n - 1) // 2
n=int(input())
cn=sum1(n)
print(cn)

Solution (Python):
N=int(input())
print((N*(N-1))//2)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 0, 1, -1, 1, -1, -1, 1]
dy = [1, -1, 0, 0, 1, -1, 1, -1]

n = INT()
print((n - 1) * n // 2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N * (N - 1) // 2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
print(N * (N-1) // 2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
n = int(input())
print((n-1)*n//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
ans = ((N)*(N-1))//2
print(ans)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
N = int(input())
ans = N * (N - 1) // 2
print(ans)

Solution (Python):
N = int(input())
print(((N-1)*N)//2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
n = int(input())
print((n-1)*n//2)

Solution (Python):
N = int(input())
print (N*(N-1)//2)

Solution (Python):
N = int(input())
print((N * (N-1)) //2)

Solution (Python):
def resolve():

    N=int(input())
    print((1+N-1)*(N-1)//2)

resolve()

Solution (Python):
n = int(input())
ans = n * (n-1) // 2
print(ans)

Solution (Python):
N = int(input())
print(N*(N-1)//2)

Solution (Python):
n=int(input())
print(n*(n-1)//2)

Solution (Python):
n = int(input())
print(n*(n-1)//2)