시간 제한메모리 제한제출정답맞은 사람정답 비율
1 초 128 MB20621493136275.793%

문제

세 대각선이 한 점에서 만나지 않는 볼록 N각형이 주어졌을 때, 대각선의 교차점의 개수를 세는 프로그램을 작성하시오.

아래 그림은 위의 조건을 만족하는 한 육각형의 교차점 그림이다.

모든 내부각이 180도보다 작은 다각형을 볼록 다각형이라고 한다.

입력

첫째 줄에 N이 주어진다. (3 ≤ N ≤ 100)

출력

첫째 줄에 교차점의 개수를 출력한다.

예제 입력 1

3

예제 출력 1

0

예제 입력 2

4

예제 출력 2

1

예제 입력 3

6

예제 출력 3

15
W3sicHJvYmxlbV9pZCI6IjMwNDkiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIyZTRcdWFjMDFcdWQ2MTVcdWM3NTggXHViMzAwXHVhYzAxXHVjMTIwIiwiZGVzY3JpcHRpb24iOiI8cD5cdWMxMzggXHViMzAwXHVhYzAxXHVjMTIwXHVjNzc0IFx1ZDU1YyBcdWM4MTBcdWM1ZDBcdWMxMWMgXHViOWNjXHViMDk4XHVjOWMwIFx1YzU0YVx1YjI5NCBcdWJjZmNcdWI4NWQgTlx1YWMwMVx1ZDYxNVx1Yzc3NCBcdWM4ZmNcdWM1YjRcdWM4NGNcdWM3NDQgXHViNTRjLCBcdWIzMDBcdWFjMDFcdWMxMjBcdWM3NTggXHVhZDUwXHVjYzI4XHVjODEwXHVjNzU4IFx1YWMxY1x1YzIxOFx1Yjk3YyBcdWMxMzhcdWIyOTQgXHVkNTA0XHViODVjXHVhZGY4XHViN2E4XHVjNzQ0IFx1Yzc5MVx1YzEzMVx1ZDU1OFx1YzJkY1x1YzYyNC48XC9wPlxyXG5cclxuPHA+XHVjNTQ0XHViNzk4IFx1YWRmOFx1YjliY1x1Yzc0MCBcdWM3MDRcdWM3NTggXHVjODcwXHVhYzc0XHVjNzQ0IFx1YjljY1x1Yzg3MVx1ZDU1OFx1YjI5NCBcdWQ1NWMgXHVjNzIxXHVhYzAxXHVkNjE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