#include <bits/stdc++.h>
using namespace std;
string s[45];
int main() {
  long long int n, p;
  scanf("%lld %lld", &n, &p);
  for (int i = 1; i <= n; ++i) {
    cin >> s[i];
  }
  long long int x = p / 2;
  long long int ans = x;
  long long int cur = 1LL;
  for (int i = n - 1; i >= 1; --i) {
    if (s[i] == "halfplus") {
      ans += ((cur * p) + x);
      cur = (cur * 2) + 1;
    } else {
      ans += (cur * p);
      cur *= 2;
    }
  }
  printf("%lld\n", ans);
}
