Numbers#773

Numbers

1 saniye
128 megabayt
Çok kolay (≈850)

Savages living on the island can only count up to two, so they use only two digits: 1 and 2. Additionally, these natives are very superstitious. They consider numbers that contain three identical consecutive digits to be unlucky, and do not use such numbers. For example, the number 1221212 is allowed because it does not contain three consecutive identical digits. However, the number 12121112 is not allowed, because it has three consecutive identical digits (in this example, they are ones).

Giriş

One integer (1 \leq n \leq 30).

Çıktı

Print the number of n-digit numbers that consist only of digits 1 and 2 and do not contain three consecutive identical digits.

Örnekler

Örnek 1

Loading
Loading

Örnek 2

Loading
Loading

Örnek 3

Loading
Loading