#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p, nb = 1, res;
  double grat = 0.5;
  string s;
  vector<string> v;
  cin >> n >> p;
  for (int i = 0; i < n; i++) {
    cin >> s;
    v.push_back(s);
  }
  for (int i = n - 2; i > -1; i--) {
    if (v[i] == "half")
      nb = nb * 2;
    else {
      nb = nb * 2 + 1;
      grat += 0.5;
    }
  }
  res = (nb - grat) * p;
  cout << res;
  return 0;
}
