시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB35272718243178.445%

문제

도미노는 여러 종류의 타일 게임에서 사용하는 조각이다. 도미노 조각은 두 칸으로 이루어져 있다. 각 칸에는 점이 찍혀있는데, 점이 안 찍혀져 있을 수도 있다. 점의 개수는 세트의 크기에 의해서 결정된다. 세트의 크기가 N인 도미노 세트에서 점의 개수는 0보다 크거나 같고, N보다 작거나 같다. 두 도미노에 찍혀잇는 점의 개수가 같다면, 두 도미노는 동일한 것이다. 예를 들어, 점이 2개와 8개 찍혀있는 도미노는 8개와 2개 찍혀있는 도미노와 같은 도미노이다.

크기가 N인 도미노 세트는 N 또는 그보다 작거나 같은 점을 포함하는 가능한 도미노를 모두 포함하고 있고, 각 도미노는 중복되지 않는다. 다음은 크기가 2인 도미노 세트이다.

N을 입력받은 뒤, 크기가 N인 도미노 세트에는 점이 몇 개 찍혀 있는지 구하는 프로그램을 작성하시오.

입력

첫째 줄에 도미노 세트의 크기 N (1 ≤ N ≤ 1000)이 주어진다.

출력

크기가 N인 도미노 세트에 찍혀 있는 점의 개수를 출력한다.

예제 입력 1

2

예제 출력 1

12

예제 입력 2

3

예제 출력 2

30

예제 입력 3

15

예제 출력 3

2040
W3sicHJvYmxlbV9pZCI6IjI5MjEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWIzYzRcdWJiZjhcdWIxNzgiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YjNjNFx1YmJmOFx1YjE3OFx1YjI5NCBcdWM1ZWNcdWI3ZWMgXHVjODg1XHViOTU4XHVjNzU4IFx1ZDBjMFx1Yzc3YyBcdWFjOGNcdWM3ODRcdWM1ZDBcdWMxMWMgXHVjMGFjXHVjNmE5XHVkNTU4XHViMjk0IFx1Yzg3MFx1YWMwMVx1Yzc3NFx1YjJlNC4gXHViM2M0XHViYmY4XHViMTc4IFx1Yzg3MFx1YWMwMVx1Yzc0MCZuYnNwO1x1YjQ1MCBcdWNlNzhcdWM3M2Nc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