#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p;
  string cad;
  cin >> n >> p;
  long long res = 0;
  long long one = 1;
  long long r = 0;
  for (int i = 0; i < n; i++) {
    cin >> cad;
    if (cad.length() > 4) {
      res = res | (one << i);
    }
  }
  while (res) {
    r += (res / 2) * p;
    if (res % 2 == 1) {
      r += (p / 2);
    }
    res /= 2;
  }
  cout << r << endl;
  return 0;
}
