#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p;
  cin >> n >> p;
  vector<bool> a(n);
  for (int i = 0; i < n; i++) {
    string t;
    cin >> t;
    if (t == "half")
      a[i] = true;
    else
      a[i] = false;
  }
  reverse(a.begin(), a.end());
  long long apples = 0;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    apples *= 2;
    if (!a[i]) apples += 1;
    ans += apples * p / 2;
  }
  cout << ans;
  return 0;
}
