#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[60], i, j, k, p, n;
  string s;
  unsigned long long int total, m = 1;
  cin >> n >> p;
  total = p / 2;
  for (i = 0; i < n; i++) {
    cin >> s;
    if (s == "half")
      a[i] = 0;
    else
      a[i] = 1;
  }
  for (i = n - 2; 0 <= i; i--) {
    if (a[i] == 1) {
      m = (m * 2) + 1;
      total += (p * ((m / 2))) + (p / 2);
    } else {
      total += (p * (m));
      m = m * 2;
    }
  }
  cout << total << endl;
}
