#include <bits/stdc++.h>
template <typename T>
bool domax(T &a, T b) {
  return (b > a ? (a = b, true) : false);
}
template <typename T>
bool domin(T &a, T b) {
  return (b < a ? (a = b, true) : false);
}
int N;
long long P, C, n;
std::vector<bool> t;
char s[9];
int main() {
  scanf("%d%lld", &N, &P);
  for (int i = 0; i < N; i++) {
    scanf(" %s", s);
    t.push_back(strlen(s) == 8);
  }
  std::reverse((t).begin(), (t).end());
  for (bool b : t) {
    if (b) {
      C += (2 * n + 1) * P / 2;
      n = 2 * n + 1;
    } else {
      C += n * P;
      n *= 2;
    }
  }
  printf("%lld\n", C);
}
