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