#include <bits/stdc++.h>
using namespace std;
const long long maxn = 100005;
long long n, c, d, ans, las[2];
struct node {
  long long t, id;
} a[maxn];
signed main() {
  scanf("%lld%lld%lld", &n, &c, &d);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i].t);
    char ch = getchar();
    while (ch != 'P' && ch != 'W') ch = getchar();
    a[i].id = (ch == 'W');
  }
  scanf("%lld", &a[n + 1].t);
  ans = d * n;
  las[0] = las[1] = a[n + 1].t;
  long long now = 0;
  las[a[n].id] = a[n].t;
  for (long long i = n - 1; i >= 1; i--) {
    if (a[i].id == a[i + 1].id)
      now += min(c * (las[1 - a[i + 1].id] - a[i + 1].t), d);
    ans = min(ans, now + c * (a[n + 1].t - a[i].t) + d * (i - 1));
    las[a[i].id] = a[i].t;
  }
  printf("%lld\n", ans);
  return 0;
}
