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