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