#include <bits/stdc++.h>
int main() {
  int n, p, c, i;
  long long ans;
  char s[50][10];
  scanf("%d%d", &n, &p);
  for (i = 0; i < n; i++) {
    scanf(" %s", s[i]);
  }
  c = 0;
  ans = 0;
  for (i = n - 1; i >= 0; i--) {
    if (strcmp(s[i], "half") == 0)
      ans *= 2;
    else {
      ans += p / 2;
      ans *= 2;
      c++;
    }
  }
  printf("%I64d\n", ans - c * p / 2);
  return 0;
}
