#include <bits/stdc++.h>
using namespace std;
char s[45][10];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  long long cnt = 0, t = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (!strcmp(s[i], "halfplus")) {
      t++;
      cnt += 1;
    }
    cnt *= 2;
  }
  cout << cnt * (long long)m / 2 - (long long)m / 2 * t << endl;
  return 0;
}
