HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > C. T. 2011 > problem:


Ball

Volume problems

• Railway turnout
• Door lock
• Maze
• Skiers
• Matrix
• Range Minimum Query
• Министерство правды
• Coins and nests
• Ball
• Huge parking
• Islands areas
• Progression
• Passing score
• Jedi vs Sith
• Сортировка времени
• Triangle2

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