Given a number , find the number of sequences composed of zeros and ones, each of length , where no three consecutive ones appear.
The input consists of a single natural number , with a maximum value of .
Output the total number of such sequences. It is guaranteed that the result will not exceed 2^{31}-1.
Example 1