#include <bits/stdc++.h>
using namespace std;
vector<bool> v;
int main() {
  long long n, p;
  string s;
  cin >> n >> p;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    if (s == "half")
      v.push_back(1);
    else
      v.push_back(0);
  }
  reverse(v.begin(), v.end());
  long long count = 0;
  for (long long i = 0; i < n; i++) {
    if (v[i] == 1)
      count = count * 2;
    else
      count = count * 2 + 1;
  }
  long long result = 0;
  while (count != 0) {
    result += (count * p) / 2;
    count /= 2;
  }
  cout << result << endl;
  return 0;
}
