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