#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p;
  cin >> n >> p;
  string s[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  long long money = 0, num = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == "halfplus") {
      money += p * num + p / 2;
      num = num * 2 + 1;
    } else {
      money += p * num;
      num *= 2;
    }
  }
  cout << money << endl;
}
