Simple python3 solution
Complexity\n- Time complexity: O(12 \cdot n) = O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(12) = O(1) \n Add your space complexity
# Complexity\n- Time complexity: $$O(12 \\cdot n) = O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(12) = O(1)$$ \n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\nwhere `12` is maximum size of prefix dict\n\n# Code\n``` python3 []\nclass Solution:\n    def stringCount(self, n: int) -> int:\n        if n < 4:\n            return 0\n\n        modulo = 1_000_000_007\n        prev = {(0, 0, 0): 1}\n        for _ in range(n):\n            current = Counter()\n\n            for k, v in prev.items():\n                # add all characters except l, e, t\n                current[k] += 23 * v\n\n                l, e, t = k\n\n                # add l\n                if l == 0:\n                    current[(l + 1, e, t)] += v\n                else:\n                    current[k] += v\n                \n                # add e\n                if e < 2:\n                    current[(l, e + 1, t)] += v\n                else:\n                    current[k] += v\n                \n                # add t\n                if t == 0:\n                    current[(l, e, t + 1)] += v\n                else:\n                    current[k] += v\n            \n            prev = {\n                k: v % modulo\n                for k, v in current.items()\n            }\n\n        return prev[(1, 2, 1)]\n\n```
['Math', 'Dynamic Programming', 'Python3']