#include <bits/stdc++.h>
using namespace std;
int a[50];
int main() {
  long long n, p, sum, val, i, l;
  char data[10];
  cin >> n >> p;
  for (i = 0; i < n; i++) {
    cin >> data;
    l = strlen(data);
    if (l == 8) a[i] = 1;
  }
  sum = 1;
  val = p / 2;
  if (n == 1)
    cout << p / 2 << endl;
  else {
    for (i = n - 2; i >= 0; i--) {
      l = a[i];
      if (l == 1) {
        sum = sum * 2;
        val = val + ((sum / 2) * p) + (p / 2);
        sum++;
      } else {
        val = val + (sum * p);
        sum = sum * 2;
      }
    }
    cout << val << endl;
  }
}
