#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, a, b, p, d, k, t, n, m, sum = 1, root, ans, hr = 0, mnt = 0,
                                          h1, h2, first = 0, cou = 1;
  cin >> n >> p;
  string s[n + 2];
  for (i = 1; i <= n; i++) cin >> s[i];
  for (i = n - 1; i >= 1; i--) {
    k = s[i].size();
    if (k == 4)
      sum = sum * 2;
    else {
      sum = sum * 2 + 1;
      cou++;
    }
  }
  cout << p * sum - p * cou / 2 << endl;
  return 0;
}
