#include <bits/stdc++.h>
using namespace std;
template <typename... T>
void read(T&... args) {
  ((cin >> args), ...);
}
template <typename... T>
void write(T&&... args) {
  ((cout << args << " "), ...);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, p;
  while (cin >> n >> p) {
    long long res(0), apples(0);
    vector<string> lst(n);
    for (int i = 0; i < n; read(lst[i++]))
      ;
    reverse(lst.begin(), lst.end());
    for (auto s : lst) apples = (apples << 1) + (s.size() > 4);
    while (apples > 0) {
      res += (apples * p) >> 1;
      apples = (apples >> 1);
    }
    cout << res << endl;
  }
  return 0;
}
