#include <bits/stdc++.h>
using namespace std;
int dx[]{1, -1, 0, 0, 1, -1, 1, -1};
int dy[]{0, 0, 1, -1, 1, -1, -1, 1};
long long suf(long long x) { return (x * (x + 1)) / 2; }
vector<vector<pair<int, int> > > adj;
const long long mod = 1e9 + 7, oo = 1e9;
int n, m, u, z, k, h;
int main() {
  while (cin >> n >> m) {
    long long ans = 0;
    string s;
    long long cur = 0;
    vector<string> st(n);
    for (int i = 0; i < n; i++) cin >> st[i];
    for (int i = n - 1; i >= 0; i--) {
      if (st[i] == "halfplus")
        ans += (cur)*m + m / 2, cur *= 2, cur++;
      else
        ans += cur * m, cur *= 2;
    }
    cout << ans << endl;
  }
  return 0;
}
