#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int NAX = 2e5 + 5, MOD = 1000000007;
struct Solution {
  Solution() {}
  void solveCase() {
    int n, p;
    cin >> n >> p;
    ll ans = 0;
    ll currAppleCnt = 0;
    stack<string> st;
    for (size_t i = 0; i < n; i++) {
      string str;
      cin >> str;
      st.push(str);
    }
    while (st.size()) {
      long double temp = currAppleCnt;
      if (st.top() == "halfplus") temp += 0.5;
      ans += temp * p;
      currAppleCnt = (2 * currAppleCnt);
      if (st.top() == "halfplus") currAppleCnt++;
      ;
      st.pop();
    }
    cout << ans << '\n';
  }
};
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  Solution mySolver;
  for (int i = 1; i <= t; ++i) {
    mySolver.solveCase();
  }
  return 0;
}
