#include <bits/stdc++.h>
using namespace std;
string s[50];
int main() {
  long long n, p;
  cin >> n >> p;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  long long res = 0;
  for (int i = n - 1; i >= 0; i--) {
    res = res * 2 + (s[i] == "halfplus");
  }
  double ans = 0;
  while (res > 0) {
    ans += res / 2.0;
    res = res >> 1;
  }
  cout << fixed << setprecision(0) << ans * p;
  return 0;
}
