#include <bits/stdc++.h>
using namespace std;
void init_ios() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}
string zap[50];
signed main() {
  init_ios();
  long long n, x = 0, k, res = 0;
  cin >> n >> k;
  for (long long i = 1; i <= n; ++i) {
    cin >> zap[i];
  }
  for (long long i = n; i >= 1; --i) {
    x *= 2;
    if (zap[i] == "halfplus") ++x;
  }
  while (x) {
    if (x % 2 == 0) {
      res += (x / 2) * k;
      x /= 2;
      continue;
    }
    res += (x / 2) * k + k / 2;
    x /= 2;
  }
  cout << res << "\n";
}
