Олимпиадный тренинг

Задача 21900. circle line


Задача

Темы: Вывод формулы
In the city where friends Andrei and Boris live, the subway consists of a single ring line along which n stations numbered from 1 to n are located at equal distances from each other. The section of the metro line between two neighboring stations is called a span.

Trains on the Circle Line move both clockwise and counterclockwise, so in order to get from one station to another, a passenger can choose the direction in which they need to travel fewer hauls. The minimum number of hauls that you need to travel to get from one station to another, we call the distance between stations.

Friends noticed that the following condition is fulfilled: if you think of some station X and write out two numbers for it: Da — distance from the station where Andrey lives to station X and Db — distance from the station where Boris lives to station X, then the resulting pair of numbers [Da, Db] will uniquely define station X.

For example, if n = 4, Andrey lives at station 1, and Boris lives at station 2, then station 1 is given by the pair [0, 1], station 2 — pair [1, 0], station 3 — pair [2, 1] and station 4 — pair [1, 2].

Their classmate Sergei lives in a nearby town and does not know which stations Andrei and Boris live at. To find friends, he became interested in how many options for pairs of stations A, B exist, such that if Andrey lives at station A, and Boris — at station B, then the above condition is met.

It is required to write a program that, by the number of stations n on the ring line, determines the required number of options.

Input file format
The first line of the input file contains a single integer n (3 ≤ n ≤ 40 000).
Output file format
The output file must contain a single number — desired number of options.

Examples of input and output files
Enter Output
4 8
5 20

Explanations for examples
In the first example, the following options are suitable:
- Andrey lives at station 1, and Boris at station 2;
- Andrey lives at station 1, and Boris at station 4;
- Andrey lives at station 2, and Boris at station 1;
- Andrey lives at station 2, and Boris at station 3;
- Andrey lives at station 3, and Boris at station 2;
- Andrey lives at station 3, and Boris at station 4;
- Andrey lives at station 4, and Boris at station 1;
- Andrey lives at station 4, and Boris at station 3.