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