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