#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1024;
int n, k, a[SIZE];
long long ans, cur;
int main() {
  cin >> n >> k;
  for (int i = n; i >= 1; i--) {
    string ii;
    cin >> ii;
    if (ii == "half") {
      a[i] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i]) {
      cur *= 2;
    } else {
      cur = cur * 2 + 1;
    }
    ans += cur;
  }
  cout << ans * k / 2;
  return 0;
}
