#include <bits/stdc++.h>
#pragma GCC optimize(3)
#pragma warning(disable : 4996)
template <typename T>
T min(T x, T y) {
  return x < y ? x : y;
}
template <typename T>
T max(T x, T y) {
  return x > y ? x : y;
};
const int MAXN = 100005;
long long N, c, d;
long long ty[MAXN], t[MAXN];
void solve() {
  long long ans = N * d;
  long long last = t[N + 1];
  long long tmp = 0;
  long long s = 0;
  for (int i = N; i >= 0; i--) {
    ans = min(ans, i * d + tmp + s);
    if (ty[i] == ty[i + 1]) {
      s -= last * c - t[i + 1] * c;
      s += min(d, last * c - t[i + 1] * c);
      s += last * c - t[i] * c;
    } else {
      tmp += s;
      last = t[i + 1];
      s = last * c - t[i] * c;
    }
  }
  printf("%I64d\n", ans);
}
void init() {
  char tmp[10];
  scanf("%I64d %I64d %I64d", &N, &c, &d);
  for (int i = 1; i <= N; i++) {
    scanf("%I64d %s", t + i, tmp);
    ty[i] = tmp[0] == 'P';
  }
  scanf("%I64d", t + N + 1);
  ty[N + 1] = 2;
}
int main() {
  init();
  solve();
  return 0;
}
