#include <bits/stdc++.h>
using namespace std;
const int mx = 500010;
int n, p;
string arr[42];
long long f(long long x) {
  long long temp = 0;
  while (x > 0) {
    if (x & 1)
      temp += p * (x - 1) / 2 + p / 2, x = (x - 1) / 2;
    else
      temp += p * x / 2, x = x / 2;
  }
  return temp;
}
int main() {
  cin >> n >> p;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  long long x = 0;
  for (int i = n; i >= 1; i--) {
    if (arr[i] == "halfplus")
      x = x * 2 + 1;
    else
      x = 2 * x;
  }
  cout << f(x) << endl;
}
