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