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