func_code_string: #include <bits/stdc++.h>   using namespace std;   template <typename A, typename B>   string to_string(pair<A, B> p);   string to_string(const string&);   string to_string(const char* s);   string to_string(bool b);   template <typename A>   string to_string(A v);   template <typename A, typename B>   string to_string(pair<A, B> p);   void debug_out();   template <typename Head, typename... Tail>   void debug_out(Head H, Tail... T);   vector<string> vec_splitter(string s);   void debug_var(vector<string> __attribute__((unused)) args,                  __attribute__((unused)) long long idx,                  __attribute__((unused)) long long LINE_NUM) {     cerr << endl;   }   template <typename Head, typename... Tail>   void debug_var(vector<string>, long long, long long, Head, Tail...);   const long long mod = 1e9 + 7;   const long long N = 1e6 + 5;   void solve() {     long long n, p;     cin >> n >> p;     string s;     vector<long long> a(n);     for (long long i = 0; i < n; ++i) {       cin >> s;       if (s.back() ==  f ) {         a[i] = 1;       }     }     long long ans = p / 2, cur = 1;     for (long long i = n - 2; i >= 0; --i) {       if (a[i]) {         ans += p * cur;         cur *= 2;       } else {         ans += p * cur + p / 2;         cur *= 2;         ++cur;       }     }     cout << ans <<   n ;   }   signed main() {     ios_base::sync_with_stdio(0);     cin.tie(NULL);     cout.tie(NULL);     solve();     return 0;   }   string to_string(const string& s) { return     + s +    ; }   string to_string(const char* s) { return to_string((string)s); }   string to_string(bool b) { return (b ?  T  :  F ); }   template <typename A>   string to_string(A v) {     bool first = true;     string res =  { ;     for (const auto& x : v) {       if (!first) {         res +=  ,  ;       }       first = false;       res += to_string(x);     }     res +=  } ;     return res;   }   template <typename Head, typename... Tail>   void debug_var(vector<string> args, long long idx, long long LINE_NUM, Head H,                  Tail... T) {     if (idx > 0)       cerr <<  ,  ;     else       cerr <<  Line(  << LINE_NUM <<  ):  ;     stringstream ss;     ss << H;     cerr << args[idx] <<   =   << ss.str();     debug_var(args, idx + 1, LINE_NUM, T...);   }   template <typename A, typename B>   string to_string(pair<A, B> p) {     return  (  + to_string(p.first) +  ,   + to_string(p.second) +  ) ;   }   void debug_out() { cerr << endl; }   template <typename Head, typename... Tail>   void debug_out(Head H, Tail... T) {     cerr <<     << to_string(H);     debug_out(T...);   }   vector<string> vec_splitter(string s) {     s +=  , ;     vector<string> res;     while (!s.empty()) {       res.push_back(s.substr(0, s.find( , )));       s = s.substr(s.find( , ) + 1);     }     return res;   }   