#include <bits/stdc++.h>
using namespace std;
long long n, p, ans = 0, total = 0, apple = 0;
int main() {
  string a[100000];
  cin >> n >> p;
  p = p >> 1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = n; i >= 1; i--) {
    total = total * 2;
    if (a[i] == "halfplus") total++;
    apple += total;
  }
  cout << apple * p;
  return 0;
}
