func_code_string: #include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   int n;   char s[5001];   int dp[5001][5001];   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; ++i) {       scanf(  n%c , &s[i]);     }     dp[1][0] = 1;     for (int j = 1; j <= n; ++j) {       dp[1][j] = 0;     }     for (int i = 2; i <= n; ++i) {       if (s[i - 1] ==  f ) {         for (int j = 1; j <= n; ++j) {           dp[i][j] = dp[i - 1][j - 1];         }       } else {         int x = 0;         for (int j = n; j >= 0; --j) {           x += dp[i - 1][j];           if (x >= mod) {             x -= mod;           }           dp[i][j] = x;         }       }     }     int res = 0;     for (int i = 0; i <= n; ++i) {       res += dp[n][i];       if (res >= mod) {         res -= mod;       }     }     cout << res <<   n ;     return 0;   }   