#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
long long cur, ans, cnt;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, p;
  cin >> n >> p;
  for (int i = 0; i < n; i++) {
    string second;
    cin >> second;
    if (second == "half") {
      v.push_back(2);
    } else {
      v.push_back(1);
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (v[i] == 1) {
      cur *= 2;
      cur++;
      cnt++;
    } else if (v[i] == 2) {
      cur *= 2;
    }
  }
  cout << p * cur - (cnt * p) / 2;
  return 0;
}
