#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long inf = LLONG_MAX;
const long long ninf = LLONG_MIN;
const long double eps = 1e-10;
const long long N = 1000005;
const long long LOGN = log2(N);
long long n, p;
string s[N];
long long power(long long a, long long b) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
    }
    y = (y * y);
    b /= 2;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> p;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    cin >> s[i];
  }
  reverse(s, s + n);
  long double pre = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == "halfplus") {
      pre += 0.5;
    }
    ans += (long long)(pre * p);
    pre *= 2;
  }
  cout << ans << "\n";
  return 0;
}
