410656: GYM104069 H Harada Football Clube

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Harada Football Clubetime limit per test0.25 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Lucas Harada is one of the biggest fans of SPFC (St. Petersburg Football Club) and also of combinatorics problems, so why not join both in a problem? A football formation tactic is a distribution of players as goalkeeper, defense, midfield, or attack in which there is exactly one goalkeeper, at least one in defense, at least one in midfield, and at least one in the attack.

For example, in a traditional soccer team with 11 players, some examples of tactical formation are 1-4-4-2, 1-5-4-1, and 1-3-4-3. Note that it doesn't matter which players are in each position, only the amount. Now Harada is wondering if a football team had $$$N$$$ players, how many tactical formations would be possible?

Input

The input consists of a single integer $$$N$$$ $$$(4 \leq N \leq 10^6)$$$, the number of players on the team.

Output

The output consists of a single integer, the number of possible tactical formations of a team with $$$N$$$ players.

ExamplesInput
4
Output
1
Input
6
Output
6
Input
11
Output
36
Input
1000000
Output
499997500003
Note

On the second testcase the possible formations are: 1-1-1-3; 1-2-2-1; 1-1-3-1; 1-2-1-2; 1-3-1-1; 1-1-2-2.

加入题单

算法标签: