LearnPy Hub
← Arena
AdvancedRating 1800

Good Attendance Records

A record of n days uses P (present), A (absent) and L (late). It is good if it has fewer than 2 A's in total and never 3 or more L's in a row. Count the good records modulo 1 000 000 007.

Input

One integer n (1 ≤ n ≤ 10⁵).

Output

One integer.

Sample 1

Input
1
Output
3

Sample 2

Input
2
Output
8
solution.py
Output appears here
Good Attendance Records · Python Arena problem · LearnPy Hub