#include <bits/stdc++.h>
using namespace std;
void in(int &n) {
  n = 0;
  int f = 1;
  char c = getchar();
  while (c < '0' || '9' < c) {
    if (c == '-') f *= -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    n = n * 10 + (c - '0');
    c = getchar();
  }
  n *= f;
}
char s[10];
bool f[45];
int main() {
  int n, m;
  in(n);
  in(m);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    int l = strlen(s);
    f[i] = (l == 4);
  }
  long long now = 0, ans = 0;
  for (int i = n - 1; i >= 0; i--)
    if (f[i])
      now *= 2;
    else
      now = now * 2 + 1;
  while (now > 0) {
    if (now % 2)
      ans += (now / 2) * m + m / 2;
    else
      ans += (now / 2) * m;
    now /= 2;
  }
  printf("%lld", ans);
  return 0;
}
