import sys

import itertools

import numpy as np



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

 

n = int(eval(input()))



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



print((N * (N - 1) // 2))
import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n = int(eval(input()))
print(((n) * (n - 1) // 2))

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

-import sys -import itertools -import numpy as np - -read = sys.stdin.buffer.read -readline = sys.stdin.buffer.readline -readlines = sys.stdin.buffer.readlines -n = int(eval(input())) -print(((n) * (n - 1) // 2)) +N = int(eval(input())) +print((N * (N - 1) // 2))