#include <bits/stdc++.h>
const int MAXN = 1e5 + 5;
int n;
long long c, d;
int a[MAXN], b[MAXN];
int suf[MAXN], lst[2];
int main() {
  scanf("%d%lld%lld", &n, &c, &d);
  for (int i = 1; i <= n; ++i) {
    char str[23];
    scanf("%d%s", a + i, str + 1);
    b[i] = (str[1] == 'P');
  }
  scanf("%d", a + n + 1);
  long long ans = 1ll * d * n;
  lst[0] = lst[1] = n + 1;
  for (int i = n; i >= 1; --i) {
    suf[i] = lst[!b[i]];
    lst[b[i]] = i;
  }
  long long sm = 0;
  for (int i = n; i >= 1; --i) {
    if (i + 1 <= n) {
      if (b[i + 1] == b[i])
        sm += std::min(d, c * (a[suf[i + 1]] - a[i + 1]));
      else
        sm += c * (a[suf[i + 1]] - a[i + 1]);
    }
    ans = std::min(ans, sm + (i - 1) * d + c * (a[suf[i]] - a[i]));
  }
  printf("%lld\n", ans);
  return 0;
}
