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