import math

import copy

import sys

import fractions

import numpy as np

from functools import reduce



# ===FUNCTION===



def getInputInt():

    inputNum = int(eval(input()))

    return inputNum



def getInputListInt():

    outputoData = []

    inputData = input().split()

    outputData = [int(n) for n in inputData]



    return outputData



def getSomeInputInt(n):

    outputDataList = []

    for i in range(n):

        inputData = int(eval(input()))

        outputDataList.append(inputData)



    return outputDataList



def getSomeInputListInt(n):

    inputDataList = []

    outputDataList = []

    for i in range(n):

        inputData = input().split()

        inputDataList = [int(n) for n in inputData]

        outputDataList.append(inputDataList)



    return outputDataList



# ===CODE===



n, = list(map(int, input().split()))

# data = getInputListInt()



if n % 2 == 0:

    ans = int(n / 2)

    ans = int(ans  * (n - 1))

else:

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

    ans = int(ans * n)



print(ans)



import sys



# import math

# import bisect



# import copy

# import heapq

# from collections import deque

# import decimal



# sys.setrecursionlimit(100001)

# INF = sys.maxsize

# MOD = 10 ** 9 + 7



ni = lambda: int(sys.stdin.readline())

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

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





# ===CODE===





def main():

    n = ni()

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

    print(ans)



if __name__ == '__main__':

    main()

import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce

# ===FUNCTION===
def getInputInt():
    inputNum = int(eval(input()))
    return inputNum


def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]
    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(eval(input()))
        outputDataList.append(inputData)
    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)
    return outputDataList


# ===CODE===
(n,) = list(map(int, input().split()))
# data = getInputListInt()
if n % 2 == 0:
    ans = int(n / 2)
    ans = int(ans * (n - 1))
else:
    ans = int((n - 1) / 2)
    ans = int(ans * n)
print(ans)

import sys

# import math
# import bisect
# import copy
# import heapq
# from collections import deque
# import decimal
# sys.setrecursionlimit(100001)
# INF = sys.maxsize
# MOD = 10 ** 9 + 7
ni = lambda: int(sys.stdin.readline())
ns = lambda: list(map(int, sys.stdin.readline().split()))
na = lambda: list(map(int, sys.stdin.readline().split()))
# ===CODE===
def main():
    n = ni()
    ans = ((n - 1) * n) // 2
    print(ans)


if __name__ == "__main__":
    main()

-import math -import copy -import fractions -import numpy as np -from functools import reduce -# ===FUNCTION=== -def getInputInt(): -    inputNum = int(eval(input())) -    return inputNum +# import math +# import bisect +# import copy +# import heapq +# from collections import deque +# import decimal +# sys.setrecursionlimit(100001) +# INF = sys.maxsize +# MOD = 10 ** 9 + 7 +ni = lambda: int(sys.stdin.readline()) +ns = lambda: list(map(int, sys.stdin.readline().split())) +na = lambda: list(map(int, sys.stdin.readline().split())) +# ===CODE=== +def main(): +    n = ni() +    ans = ((n - 1) * n) // 2 +    print(ans) -def getInputListInt(): -    outputoData = [] -    inputData = input().split() -    outputData = [int(n) for n in inputData] -    return outputData - - -def getSomeInputInt(n): -    outputDataList = [] -    for i in range(n): -        inputData = int(eval(input())) -        outputDataList.append(inputData) -    return outputDataList - - -def getSomeInputListInt(n): -    inputDataList = [] -    outputDataList = [] -    for i in range(n): -        inputData = input().split() -        inputDataList = [int(n) for n in inputData] -        outputDataList.append(inputDataList) -    return outputDataList - - -# ===CODE=== -(n,) = list(map(int, input().split())) -# data = getInputListInt() -if n % 2 == 0: -    ans = int(n / 2) -    ans = int(ans * (n - 1)) -else: -    ans = int((n - 1) / 2) -    ans = int(ans * n) -print(ans) +if __name__ == "__main__": +    main()