#include <bits/stdc++.h>
using namespace std;
long long p, ans, num;
int n;
string s[50];
int main() {
  scanf("%d%lld", &n, &p);
  p /= 2;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = n; i >= 1; i--) {
    num *= 2;
    if (s[i] == "halfplus") num++;
    ans += num;
  }
  printf("%lld", ans * p);
}
