In Piatra Neamt City there are N+2 locations labeled from 0 to N+1, from left to right. The distance between two locations i and j is equal to ∣i–j∣.
At the beginning, in the locations 0 and N+1, petrol stations are built, and in the other locations there are houses.
The company BuildNT has decided to build N petrol stations, one in front of each house.
Before building a petrol station, the constructors calculate the value S equal to the sum of the distances from each house to the nearest petrol station, and add this sum to a total sum T. Then, they choose a house, at the maximum distance of any petrol station, in front of which they will build a new petrol station. The house is chosen in such a way that, after the construction of the petrol station, the recalculated value of S should be the minimum possible. If there are more such houses, the first one on the left will be chosen.
Task
Of course, after all the petrol stations are built, the sum S will become 0 and the total sum T will no longer change. Your task is to calculate T for a given N.
The first line contains only one number N – the number of houses.
Output data
Display a single number – the total sum T after the N petrol stations have been built.
Constraints and clarifications
- 1≤N≤1 000 000 000
- For 30% of testcases, N≤10 000.
- For other 30% of testcases, N≤1 000 000.
Example
stdin
12
stdout
124
Explanation
In the table below, there is an explanation for calculating T for N=12. The first column contains the distances from every location (including the locations 0 and N+1=13) to the closest petrol station.
Distances for all locations |
S |
T |
The location where a petrol station is built |
0 1 2 3 4 5 6 6 5 4 3 2 1 0 |
42 |
42 |
6 |
0 1 2 3 2 1 0 1 2 3 3 2 1 0 |
21 |
63 |
9 |
0 1 2 3 2 1 0 1 1 0 1 2 1 0 |
15 |
78 |
3 |
0 1 1 0 1 1 0 1 1 0 1 2 1 0 |
10 |
88 |
11 |
0 1 1 0 1 1 0 1 1 0 1 0 1 0 |
8 |
96 |
1 |
0 0 1 0 1 1 0 1 1 0 1 0 1 0 |
7 |
103 |
2 |
0 0 0 0 1 1 0 1 1 0 1 0 1 0 |
6 |
109 |
4 |
0 0 0 0 0 1 0 1 1 0 1 0 1 0 |
5 |
114 |
5 |
0 0 0 0 0 0 0 1 1 0 1 0 1 0 |
4 |
118 |
7 |
0 0 0 0 0 0 0 0 1 0 1 0 1 0 |
3 |
121 |
8 |
0 0 0 0 0 0 0 0 0 0 1 0 1 0 |
2 |
123 |
10 |
0 0 0 0 0 0 0 0 0 0 0 0 1 0 |
1 |
124 |
12 |
0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
0 |
124 |
Finish |