#include <bits/stdc++.h>
using namespace std;
string s[45];
int main() {
  int n, p;
  scanf("%d%d", &n, &p);
  for (int i = 0; i < n; ++i) cin >> s[i];
  reverse(s, s + n);
  long long ans = 0;
  long long k = 0;
  for (int i = 0; i < n; ++i) {
    k *= 2;
    if (s[i] == "halfplus") k++;
    ans += (k * p) / 2;
  }
  cout << ans;
}
