Codeforces Round 328 (Div. 2)
B
The Monster and the Squirrel
Codeforces
1100
原题
← AC →
翻译中…

Ari the monster always wakes up very early with the first ray of the sun and the first thing she does is feeding her squirrel.

翻译中…

Ari draws a regular convex polygon on the floor and numbers it's vertices $1, 2, ..., *n*$ in clockwise order. Then starting from the vertex $1$ she draws a ray in the direction of each other vertex. The ray stops when it reaches a vertex or intersects with another ray drawn before. Ari repeats this process for vertex $2, 3, ..., *n*$ (in this particular order). And then she puts a walnut in each region inside the polygon.

翻译中…

image

翻译中…

Ada the squirrel wants to collect all the walnuts, but she is not allowed to step on the lines drawn by Ari. That means Ada have to perform a small jump if she wants to go from one region to another. Ada can jump from one region P to another region Q if and only if P and Q share a side or a corner.

翻译中…

Assuming that Ada starts from outside of the picture, what is the minimum number of jumps she has to perform in order to collect all the walnuts?

翻译中…

Input

翻译中…

The first and only line of the input contains a single integer $*n*$ ($3 ≤ *n* ≤ 54321$) - the number of vertices of the regular polygon drawn by Ari.

翻译中…

Output

翻译中…

Print the minimum number of jumps Ada should make to collect all the walnuts. Note, that she doesn't need to leave the polygon after.

翻译中…

Note

翻译中…

One of the possible solutions for the first sample is shown on the picture above.

翻译中…

样例

Input #1
5
Output #1
9
InputCopy OutputCopy
Input #2
3
Output #2
1
InputCopy OutputCopy
题目信息
题号
592B
时间限制
1 s
内存限制
256 MB
标签
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。