#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p;
  cin >> n >> p;
  vector<int> ts;
  string s;
  getline(cin, s);
  for (int i = 0; i < n; ++i) {
    getline(cin, s);
    if (s == "half") {
      ts.push_back(0);
    } else {
      ts.push_back(1);
    }
  }
  reverse(ts.begin(), ts.end());
  long long cur = 0;
  long long ans = 0;
  for (int i = 0; i < ts.size(); ++i) {
    if (ts[i]) {
      cur = cur * 2LL + 1LL;
    } else {
      cur = cur * 2LL;
    }
    ans += p * cur / 2LL;
  }
  cout << ans;
  return 0;
}
