HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Ball

Section problems

• Find all duplicates in array
• Find the Missing number
• Matrix
• Range Minimum Query
• Министерство правды
• Coins and nests
• Монополия
• Муравей
• Ball
• Наименьшее число
• Новый язык программирования
• Huge parking
• Одного ли цвета?
• Перестановки
• Перестановки (2)
• Islands areas
• Площадь многоугольника

Feedback

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

Time limit 1000/1000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

There is a ball at the top of the ladder containing N steps. All of a sudden it starts jumping down the stairs and it appears that the ball can jump to next step, on the step after one and on the step after two (that is if the ball lies on the step number 3 it can jump to steps number 4, 5 and 6). How many different routes are there the ball can reach last stair?

Input

A single integer: N, number of stairs (0 < N < 31).

Output

Single integer, number of different routes.

Example

stdin stdout

2

2

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

www.contester.ru