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