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