#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, p, b = 0;
  cin >> n >> p;
  vector<long long> v;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (s == "half") {
      v.push_back(0);
    } else
      v.push_back(1), b++;
  }
  reverse(v.begin(), v.end());
  long long at = 0;
  for (int i = 0; i < n; ++i) {
    at *= 2;
    at += v[i];
  }
  cout << (at * p) - (b * p / 2) << endl;
  return 0;
}
