#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, p;
  cin >> n >> p;
  vector<string> vect(n);
  for (int i = 0; i < n; i++) cin >> vect[i];
  long long int start = 0;
  long long int total = 0;
  for (int i = n - 1; i > -1; i--) {
    if (vect[i] == "halfplus") {
      start = 2 * start + 1;
      total += start * p / 2;
    } else {
      start = 2 * start;
      total += start * p / 2;
    }
  }
  cout << total << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
