Description

Given integer n, count strings of length n consisting only of vowels (a, e, i, o, u) that follow specific transition rules between consecutive characters.

Examples

Input:n = 1
Output:5
Explanation:

a, e, i, o, u.

Input:n = 3
Output:19
Explanation:

Following vowel transition rules (a→e, e→a/i, i→a/e/o/u, o→i/u, u→a), there are 19 valid strings of length 3.

Input:n = 4
Output:35
Explanation:

Applying the vowel transition rules through 4 positions yields 35 valid strings.

Constraints

  • 1 ≤ n ≤ 2 × 10⁴

Ready to solve this problem?

Practice solo or challenge other developers in a real-time coding battle!