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