HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Algorithms and Data Structures > problem:


15. Bit Strings

Volume problems

• 07. B. Влюбленная Duff
• 08. B. Песня о любви
• 09. Weird Algorithm
• 10. А. Любовь «А»
• 11. Missing Number
• 12. D. Love-Hate
• 13. Repetitions
• 14. Increasing Array
• 15. Bit Strings
• 16. Josephus Queries
• 18. Apartments
• 19. Ferris Wheel
• 20. Two Sets
• 21. Distinct Numbers
• 22. Creating Strings
• 24. Coin Piles
• 27. Dice Combinations

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. Difficulty Alpha


Your task is to calculate the number of bit strings of length n.

For example, if n=3, the correct answer is 8, because the possible bit strings
are 000, 001, 010, 011, 100, 101, 110, and 111.

Input
The only input line has an integer n.
Output
Print the result modulo 109+7.

Constraints
1≤n≤106

Example
Input:
3
Output:
8

Для отправки решений необходимо выполнить вход.

www.contester.ru