L=int(input()) total = 0 for i in range(3,L+1): total += L-i+1 print(total)