Hide

Problem I
Siblings Card Game

You and your brother received a box of $n$ distinct monster cards for Christmas. You eagerly open the instructions and learn the basics of the game setup. A match between two players is played using a deck chosen from the box, where the order of the cards does not matter. Delighted by the many possible deck combinations, you and your brother decide to play many games with different decks to determine which of you is the better player.

As you read the rules, you realize that the number of cards in the deck significantly affects how the game is played. Therefore, you divide the game into several formats, each of which specifies the size of the deck used in a match. For example, the 10-card format of the game is always played with decks containing exactly 10 cards. The size of the deck defining the format must be between $1$ and $n$ (inclusive). You and your brother will compete against each other in these different formats.

For a given format, you will play one match for every possible deck of that size, and the winner of the format is the player who achieves the most wins. Since you two are very competitive, you don’t want the possibility of a tie, so you will only play formats that have an odd number of possible decks.

You eagerly run to your computer to determine the number of valid formats while your brother continues reading the rules.

Input

The input contains a single integer $n$ ($1 \leq n \leq 10^{6}$), the number of cards in the box.

Output

Output the number of valid formats.

Sample Input 1 Sample Output 1
4
1
Sample Input 2 Sample Output 2
6
3

Please log in to submit a solution to this problem

Log in