Three ones in a row#4054

Three ones in a row

1 second
64 megabytes
Very easy

Given a number , find the number of sequences composed of zeros and ones, each of length , where no three consecutive ones appear.

Input

The input consists of a single natural number , with a maximum value of .

Output

Output the total number of such sequences. It is guaranteed that the result will not exceed 2^{31}-1.

Examples

Example 1

Loading
Loading