#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e9;
const long long OOL = 1e18;
const long long MODi = 1e9 + 7;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
const int N = 100;
vector<int> prime;
bool mat[1000001] = {0};
void generate_primes(int n) {
  prime.clear();
  prime.push_back(2);
  for (int i = 3; i * i <= n; i += 2) {
    if (mat[i] == 0) {
      for (int j = i * i; j < n; j += 2 * i) mat[j] = 1;
    }
  }
  for (int i = 3; i <= n; i += 2)
    if (!mat[i]) prime.push_back(i);
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return (b == 0 ? a : gcd(b, a % b));
}
unsigned long long lcm(unsigned long long a, unsigned long long b) {
  return (a * (b / gcd(a, b)));
}
unsigned long long power(unsigned long long a, unsigned long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  unsigned long long ans = power(a, b / 2);
  ans = ans * ans;
  if (b % 2 != 0) ans *= a;
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  long long n, p;
  cin >> n >> p;
  vector<int> v;
  for (int i = 0; i < (int)(n); ++i) {
    string s;
    cin >> s;
    if (s == "half")
      v.push_back(0);
    else
      v.push_back(1);
  }
  long long ans = 0;
  long long app = 0;
  for (int i = (n - 1); i >= (int)(0); --i) {
    app *= 2;
    if (v[i] == 1) app++;
    ans += app * (double)(p / 2) + 0.5;
  }
  cout << ans << endl;
  return 0;
}
