#include <bits/stdc++.h>
using namespace std;
int a[10000];
int main() {
  int n, p;
  cin >> n >> p;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if ((int)s.size() > 5)
      a[i] = 1;
    else
      a[i] = 0;
  }
  long long now = 0;
  long long nn = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (a[i] == 1) {
      nn += now * p;
      nn += p / 2;
      now = now * 2 + 1;
    } else {
      nn += now * p;
      now *= 2;
    }
  }
  cout << nn << "\n";
  return 0;
}
