#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[10];
  int n, p, flag = 0, b[41] = {-1};
  double a = 0;
  scanf("%d %d", &n, &p);
  for (int i = 0; i < n; i++) {
    scanf("%s", &s);
    if (strlen(s) < 5)
      b[i] = 0;
    else {
      flag++;
      b[i] = 1;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (b[i] == 1)
      a = (a + 0.5) * 2;
    else if (b[i] == 0)
      a = a * 2;
  }
  long long sum = 0;
  sum = (a - flag * 0.5) * p;
  printf("%I64d\n", sum);
  return 0;
}
