#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
using namespace std;
long long p, egg, num;
long long n;
string s[50];
signed main() {
  scanf("%lld%lld", &n, &p);
  p >>= 1;
  for (long long i = 1; i <= n; i++) cin >> s[i];
  for (long long i = n; i >= 1; i--) {
    num <<= 1;
    if (s[i] == "halfplus") num++;
    egg += num;
  }
  printf("%lld\n", egg * p);
  return 0;
}
