#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e2 + 7;
long long ans, n, p, gift;
string s[MAX];
int main() {
  cin >> n >> p;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = n - 1; i >= 0; i--) ans = (ans * 2) + (s[i] == "halfplus");
  gift = __builtin_popcountll(ans);
  cerr << 11 << " : "
       << "gift"
       << " -> " << gift << endl;
  cout << (ans * p) - (long long)(gift * (p / 2)) << "\n";
  return 0;
}
