#include <bits/stdc++.h>
using namespace std;
string s[44];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, p, i;
  cin >> n >> p;
  for (i = 1; i <= n; i++) {
    cin >> s[i];
  }
  long long sum = 0, q = 0;
  for (i = n; i >= 1; i--) {
    if (s[i] == "halfplus") {
      sum = sum * 2 + 1;
      q = q + (sum / 2) * p + p / 2;
    } else {
      q = q + sum * p;
      sum *= 2;
    }
  }
  cout << q;
  return 0;
}
