#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, p;
  cin >> n >> p;
  vector<string> a(n);
  for (auto &t : a) {
    cin >> t;
  }
  long long cur = 0;
  reverse(a.begin(), a.end());
  for (auto t : a) {
    cur *= 2;
    if (t == "halfplus") cur++;
  }
  reverse(a.begin(), a.end());
  long long ans = 0;
  for (auto t : a) {
    ans += p * (cur / 2);
    if (cur % 2 == 1) {
      ans += p / 2;
    }
    cur /= 2;
  }
  cout << ans << endl;
}
