#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, p, z = 1, i, ans, x = 1;
  string a[100];
  cin >> n >> p;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = n - 2; i >= 0; i--) {
    ans += p * z;
    if (a[i] == "half") {
      z *= 2;
    } else {
      z *= 2;
      z++;
      x++;
    }
  }
  ans += p * (x / 2);
  x %= 2;
  if (x != 0 && p % 2 != 0) {
    cout << ans + p / 2 << ".5" << endl;
  } else {
    if (x != 0) {
      ans += p / 2;
    }
    cout << ans << endl;
  }
}
