#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int valu = 0;
  vector<string> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  double l = 0.0;
  long long int cost = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (v[i] == "halfplus") {
      cost += (long long int)l * k;
      cost += k / 2;
      l = l * 2.0 + 1.0;
    } else {
      cost += (long long int)l * k;
      l = l * 2.0;
    }
  }
  cout << cost << endl;
}
