#include <bits/stdc++.h>
using namespace std;
int n, p;
long long a, sum;
int cnt[45];
char s[9];
const char b[9] = "half";
int main() {
  a = sum = 1;
  scanf("%d%d", &n, &p);
  for (int i = 1; i < n; i++) {
    scanf("%s", s);
    if (strcmp(b, s) == 0)
      cnt[i] = 0;
    else
      cnt[i] = 1;
  }
  for (int i = n - 1; i > 0; i--) {
    a = a * 2 + cnt[i];
    sum += a;
  }
  p /= 2;
  printf("%I64d", sum * p);
  return 0;
}
