A string consisting of the letters , , and is called forbidden if it contains three consecutive letters, one of which is , one is , and one is . For example, the string BAACAACCBAAA is forbidden, while AABBCCAABB is not.
Calculate the number of non-forbidden strings of length .
Each line contains a single integer n~(1 \le n \le 30).
For each input value of , print on a separate line the number of non-forbidden strings of length .
Exemple 1