#include <bits/stdc++.h>
using namespace std;
const int MAXN = 40 + 5;
string a[MAXN];
int main() {
  int n, p;
  double sum = 0, b;
  long long res = 0;
  cin >> n >> p;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] == "halfplus") {
      sum = (sum + 0.5) * 2;
      b = sum / 2;
    } else {
      b = sum;
      sum *= 2;
    }
    res += b * p;
  }
  cout << res;
  return 0;
}
