#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p;
  cin >> n >> p;
  unsigned long long a = 0;
  unsigned long long k = 0;
  int t = 0;
  int d[n];
  string s;
  for (int i = 0; i < n; ++i) {
    d[i] = 0;
    cin >> s;
    if (s == "half") d[i]++;
  }
  for (int i = n - 1; i >= 0; --i) {
    k += k;
    if (d[i] == 0) {
      ++k;
      t += p / 2;
    }
  }
  a = k * p - t;
  cout << a << endl;
}
