#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pl = pair<long long, long long>;
using pd = pair<long double, long double>;
using vi = vector<int>;
using vl = vector<long long>;
using vs = vector<string>;
using vpi = vector<pair<int, int>>;
using vpl = vector<pair<long long, long long>>;
using vpd = vector<pair<double, double>>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
const long long MOD = 998244353;
template <class A>
void re(complex<A>& c);
template <class A, class B>
void re(pair<A, B>& p);
template <class A>
void re(vector<A>& v);
template <class A, size_t SZ>
void re(array<A, SZ>& a);
template <class T>
void re(T& x) {
  cin >> x;
}
void re(double& d) {
  string t;
  re(t);
  d = stod(t);
}
void re(long double& d) {
  string t;
  re(t);
  d = stold(t);
}
template <class H, class... T>
void re(H& h, T&... t) {
  re(h);
  re(t...);
}
template <class A>
void re(complex<A>& c) {
  A a, b;
  re(a, b);
  c = {a, b};
}
template <class A, class B>
void re(pair<A, B>& p) {
  re(p.first, p.second);
}
template <class A>
void re(vector<A>& x) {
  for (auto& i : x) re(i);
}
template <class A, size_t SZ>
void re(array<A, SZ>& x) {
  for (auto& i : x) re(i);
}
string to_string(char c) { return string(1, c); }
string to_string(bool b) { return b ? "true" : "false"; }
string to_string(const char* second) { return (string)second; }
string to_string(string second) { return second; }
template <class A>
string to_string(complex<A> c) {
  stringstream ss;
  ss << c;
  return ss.str();
}
string to_string(vector<bool> v) {
  string res = "{";
  for (int i = 0; i < ((int)(v).size()); ++i) res += char('0' + v[i]);
  res += "}";
  return res;
}
template <size_t SZ>
string to_string(bitset<SZ> b) {
  string res = "";
  for (int i = 0; i < SZ; ++i) res += char('0' + b[i]);
  return res;
}
template <class A, class B>
string to_string(pair<A, B> p);
template <class T>
string to_string(T v) {
  bool fst = 1;
  string res = "{";
  for (const auto& x : v) {
    if (!fst) res += ", ";
    fst = 0;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <class A, class B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void DBG() { cerr << "]" << endl; }
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
void EDBG(string names) { names = names; }
template <class H, class... T>
void EDBG(string names, H h, T... t) {
  auto pos = names.find(',');
  auto first_name = names.substr(0, pos);
  auto rest = names.substr(pos + 1);
  while (rest.front() == ' ') {
    rest = rest.substr(1);
  }
  cerr << "[" << first_name << "]: [" << to_string(h) << "]"
       << "\n";
  EDBG(rest, t...);
}
void pr() {}
template <typename H, typename... T>
void pr(H var1, T... var2) {
  cout << var1;
  pr(var2...);
}
void ps() { cout << "\n"; }
template <typename H, typename... T>
void ps(H var1, T... var2) {
  cout << var1 << ' ';
  ps(var2...);
}
void CowGoesMoo() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(20);
}
void setIO(string second) {
  freopen((second + ".in").c_str(), "r", stdin);
  freopen((second + ".out").c_str(), "w", stdout);
}
ll gld(ll a, ll b) { return (a - (a % b)); }
ll cdiv(ll a, ll b) { return a / b + !(a < 0 || a % b == 0); }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return (a / (gcd(a, b)) * b); }
ll pow(ll a, ll b) {
  ll res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
    b >>= 1;
  }
  return res;
}
int n, p;
vs a;
int main() {
  CowGoesMoo();
  re(n, p);
  a.resize(n);
  re(a);
  ll cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] == "halfplus") {
      cnt = 2 * cnt + 1;
    } else {
      cnt *= 2;
    }
  }
  ll ans = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == "plus") {
      cnt /= 2;
      ans += cnt * p;
    } else {
      ans += (((double)(cnt + 1) / 2) - 0.5) * p;
      cnt -= (cnt + 1) / 2;
    }
  }
  ps(ans);
}
