#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
int n, c, d;
int t[MAXN], type[MAXN];
long long f[MAXN];
std::vector<std::pair<int, int> > v[2];
int main() {
  scanf("%d%d%d", &n, &c, &d);
  for (int i = 1; i <= n; i++) {
    char buff[5];
    scanf("%d%s", t + i, buff);
    type[i] = buff[0] == 'W';
    v[type[i]].emplace_back(t[i], i);
  }
  scanf("%d", t + n + 1);
  f[n + 1] = 0;
  long long ans = 0;
  int last = n + 1;
  for (int i = n; i >= 1; i--) {
    if (i == 1 || type[i] != type[i - 1]) {
      long long tmp = f[last];
      for (int j = i; j < last; j++) {
        tmp += std::min(0ll, 1ll * c * (t[last] - t[j]) - d);
      }
      ans = std::min(ans, tmp);
      if (1ll * (t[last] - t[i]) * c < d) {
        f[i] = tmp;
      } else {
        f[i] = tmp + 1ll * (t[last] - t[i]) * c - d;
      }
      last = i;
    }
  }
  printf("%lld\n", ans + 1ll * d * n);
}
