#include <bits/stdc++.h>
using namespace std;
long long n, p, acm, cur;
vector<string> vet;
int main() {
  cin >> n >> p;
  acm = 0;
  cur = 0;
  string str;
  while (n--) {
    cin >> str;
    vet.push_back(str);
  }
  for (int i = vet.size() - 1; i >= 0; i--) {
    acm += cur * p;
    cur *= 2;
    if (vet[i] == "halfplus") {
      cur++;
      acm += p / 2;
    }
  }
  cout << acm << "\n";
  return 0;
}
