QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 256 MB Points totaux : 100

#15777. Selecting Numbers from a Set

Statistiques

A homework problem in the "Set Theory and Graph Theory" course asks students to find all subsets of $\{1, 2, 3, 4, 5\}$ that satisfy the following condition: if $x$ is in the subset, then $2x$ and $3x$ cannot be in the subset. Students do not like such problems that require enumeration, so they have transformed it into the following problem: for any positive integer $n \le 100000$, how to find the number of subsets of $\{1, 2, \dots, n\}$ that satisfy the above constraint (only the result modulo $1,000,000,001$ needs to be output). Now, this problem is handed to you.

Input

The input contains a single line with a positive integer $n$, where $30\%$ of the data satisfies $n \le 20$.

Output

The output contains a single positive integer representing the number of subsets of $\{1, 2, \dots, n\}$ that satisfy the above constraint.

Examples

Input 1

4

Output 1

8

Note

There are 8 subsets that satisfy the requirements: the empty set, $\{1\}$, $\{1, 4\}$, $\{2\}$, $\{2, 3\}$, $\{3\}$, $\{3, 4\}$, and $\{4\}$.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.