#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p;
  while (~scanf("%d%d", &n, &p)) {
    string s[45];
    for (int i = 0; i < n; i++) cin >> s[i];
    long long now = 0;
    long long ans = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == "half") {
        ans += now * p;
        now = now * 2;
      } else {
        ans += p / 2 + now * p;
        now = now * 2 + 1;
      }
    }
    printf("%I64d\n", ans);
  }
}
