#include <bits/stdc++.h>
using namespace std;
int n, p;
stack<bool> b;
long long q, a;
int main() {
  cin >> n >> p;
  char temp[256];
  for (int i = 0; i < n; i++) {
    cin >> temp;
    b.push(strcmp(temp, "half"));
  }
  do {
    if (b.top())
      q = q * 2 + 1;
    else
      q = q * 2;
    a += q * p / 2;
    b.pop();
  } while (!b.empty());
  cout << a << endl;
}
