#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long a = 0;
  int f = 0;
  char p = getchar();
  while (!isdigit(p)) {
    f |= p == '-';
    p = getchar();
  }
  while (isdigit(p)) {
    a = (a << 3) + (a << 1) + (p ^ 48);
    p = getchar();
  }
  return f ? -a : a;
}
char s[45][10];
int n, p;
double sum, a[45];
long long ans;
int main() {
  n = read();
  p = read();
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s[i] + 1);
    a[i] = strlen(s[i] + 1) == 8 ? 0.5 : 0;
  }
  while (n) {
    sum += a[n];
    ans += sum * p;
    sum *= 2;
    --n;
  }
  printf("%lld", ans);
  return 0;
}
