#include <bits/stdc++.h>
using namespace std;
char s[10];
int a[1000010];
int main() {
  int n, p, i, j;
  long long jin = 0, m;
  scanf("%d%d", &n, &p);
  p /= 2;
  for (i = 0; i < n; i++) {
    scanf("%s", s);
    if (strcmp(s, "half"))
      a[i] = 1;
    else
      a[i] = 0;
  }
  m = 0;
  for (i = n - 1; i >= 0; i--) {
    m *= 2;
    if (a[i]) m++;
  }
  for (i = 0; i < n; i++) {
    jin = jin + m * p;
    m /= 2;
  }
  printf("%I64d\n", jin);
}
