C++
\nusing LL = long long;\nclass Solution {\n    LL dp[100005][2][3][2];\n    LL M = 1e9+7;\npublic:\n    int stringCount(int n) \n    {\n        dp[0][0][0][0] =
```\nusing LL = long long;\nclass Solution {\n    LL dp[100005][2][3][2];\n    LL M = 1e9+7;\npublic:\n    int stringCount(int n) \n    {\n        dp[0][0][0][0] = 1;\n        for (int i=1; i<=n; i++)\n            for (int a=0; a<2; a++)\n                for (int b=0; b<3; b++)\n                    for (int c=0; c<2; c++)\n                    {\n                        for (char ch=\'a\'; ch <=\'z\'; ch++)\n                        {\n                            if (ch == \'l\' && a==1)\n                                dp[i][a][b][c] += dp[i-1][0][b][c];\n                            else if (ch == \'e\' && b==1)\n                                dp[i][a][b][c] += dp[i-1][a][0][c];\n                            else if (ch == \'e\' && b==2)\n                                dp[i][a][2][c] += dp[i-1][a][1][c];\n                            else if (ch == \'t\' && c==1)\n                                dp[i][a][b][c] += dp[i-1][a][b][0];\n                            else\n                                dp[i][a][b][c] += dp[i-1][a][b][c];                                \n                            dp[i][a][b][c] %= M;\n                        }\n                    }\n        return dp[n][1][2][1];\n    }\n};\n```
[]