#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, p;
  cin >> n >> p;
  string a[n];
  long long int cur = 0;
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long int i = n - 1; i >= 0; i--) {
    if (a[i].size() == 8) {
      ans += cur * p + p / 2;
      cur = cur * 2 + 1;
    } else {
      ans += cur * p;
      cur *= 2;
    }
  }
  cout << ans << endl;
  return 0;
}
