#include <bits/stdc++.h>
using namespace std;
const int MAXN = 45;
string s[MAXN];
long long n, p, ans, cnt;
int main() {
  scanf("%lld%lld", &n, &p);
  for (int i = 1; i <= n; ++i) cin >> s[i];
  for (int i = n; i >= 1; --i) {
    if (s[i] == "halfplus") {
      ans += p / 2 + p * cnt;
      cnt = cnt * 2 + 1;
    } else {
      ans += p * cnt;
      cnt *= 2;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
