#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 998244353, LIM = 4294967295;
long long int n, m, a, b, c, d, q, k, tr, summ, ans, minx, maxx, l, r, mid, l1,
    r1, mid1, res, mass[1000001], mass1[1000001];
string s, trs, str, ss;
set<long long int> g, bb, all;
set<long long int> myset, myset1;
vector<long long int> myvec1, toWrite, myvec2;
vector<vector<long long int>> myvecvec;
vector<pair<long long int, long long int>> mm, mm1;
vector<long long int> mvv[1001], myvec;
queue<long long int> myq[200001];
map<long long int, long long int> mymap, mymap1, mymap2;
map<long long int, vector<long long int>> mymapvec, childs;
multiset<long long int> mmset;
unordered_map<string, long long int> smap;
map<long long int, long long int> mmap;
int compare(const void* a, const void* b) {
  return -((*(long long int*)a) - (*(long long int*)b));
};
long long int gcd(long long int a, long long int b) {
  while (b != 0) {
    long long int t = b;
    b = a % b;
    a = t;
  }
  return a;
}
long long int gcdex(long long int a, long long int b, long long int& x,
                    long long int& y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  long long int x1, y1;
  long long int d = gcdex(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
long long int NOK(long long int n1, long long int n2) {
  return n1 * n2 / gcd(n1, n2);
}
long long int bin_pow(long long int base, long long int p) {
  if (p == 1) {
    return base % MOD;
  }
  if (p == 0) {
    return 1;
  }
  if (p % 2 == 0) {
    long long int t = bin_pow(base, p / 2) % MOD;
    return t * t % MOD;
  } else {
    return bin_pow(base, p - 1) * base % MOD;
  }
}
long long int inverse_element(long long int x) { return bin_pow(x, MOD - 2); }
long long int divide(long long int a, long long int b) {
  return a * inverse_element(b) % MOD;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  q = 1;
  while (q--) {
    cin >> n >> m;
    summ = 0;
    a = 0;
    vector<string> myvec;
    for (long long int i = 0; i < n; i++) {
      cin >> s;
      myvec.push_back(s);
    }
    for (auto i = myvec.rbegin(); i != myvec.rend(); i++) {
      s = *i;
      summ += a * m;
      if (s == "half") {
        a *= 2;
      } else {
        a = a * 2 + 1;
        summ += m / 2;
      }
    }
    cout << summ;
  }
  return 0;
}
