Problem Description
In the alphabet, there are only two letters: A and B.
We consider strings of length consisting only of these letters.
A string is called correct if all the following conditions are met:
- the first and last letters are
A; - there are no two
As in a row (the substringAAis forbidden); - there are no three
Bs in a row (the substringBBBis forbidden).
For example, the strings ABBA, ABABABA, ABBABABBA are correct, while the strings ABBAB, ABAABA, ABABBBA are not.
We need to find the number of correct strings of length .
Input
The first line contains one integer — the length of the string.
Output
Output the number of correct strings of length modulo .
Scoring System
| Subtasks | Additional Constraints | Points | Required Subtasks |
|---|---|---|---|
| 0 | Example | 0 | — |
| 1 | 10 | 0 | |
| 2 | 30 |
Examples
Example 1
Input
4
Output
1
Example 2
Input
6
Output
2