This page is still under construction.

Parts of this page are still being built. What you see may change.

Vera's Fashion

Interview

Time limit2sMemory limit256 MB

Summary
Given N tops and N bottoms colored 1 to N, count how many top and bottom pairs have different colors.
Level

Easy1 of 10

Topics
Math, Combinatorics, Implementation
Solved
No attempts yet

Problem

Vera owns NN tops and NN bottoms. The ii-th top and the ii-th bottom both have color ii. The NN colors are all different.

Vera picks one top and one bottom. How many such pairs have a top and a bottom of different colors?

Input

The input is given in the following form.

N

Output

Print the number of pairs whose top and bottom have different colors, on one line.

Constraints

  • 1≤N≤20171 \le N \le 2017
  • NN is an integer.

Examples3

  1. Example 1

    Input
    1
    
    Expected output
    0
    
  2. Example 2

    Input
    2
    
    Expected output
    2
    
  3. Example 3

    Input
    5
    
    Expected output
    20