Hide

Problem J
We Need to Go Deeper

/problems/weneedtogodeeper/file/statement/en/img-0001.png
Nether Portal, Minecraft Wiki

Steve, Alex, and Kai have finally collected enough obsidian to get to the Nether, but something is on Steve’s mind. The three have collected quite a lot of obsidian, and Steve has heard that nether portals must be made as an empty rectangular frame (including the corners for this problem) with width at least 4 and at most 23 and height at least 5 and at most 23.

Given the amount of obsidian the three have, how many different ways can a single nether portal be created (leftover obsidian is okay). For our purposes, we count both orientations as distinct as long as the portal is not square (so $5 \times 5$ is a unique configuration, but $5 \times 6$ is a distinct configuration from $6 \times 5$).

Input

The input contains a single integer, $x$, the amount of obsidian. You are given that $1 \le x \le 23^2$.

Output

Output a single integer, $y$, the number of distinct nether portal configurations that can be achieved.

Sample Input 1 Sample Output 1
14
1
Sample Input 2 Sample Output 2
13
0
Sample Input 3 Sample Output 3
35
66

Please log in to submit a solution to this problem

Log in