#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
template <class T>
inline void ckmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void ckmax(T& a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  long long cost, delta;
  while (cin >> n >> cost >> delta) {
    vector<long long> a(n + 1);
    vector<int> bit(n);
    for (int i = 0; i < (n); ++i) {
      int x;
      string y;
      cin >> x >> y;
      a[i] = x;
      bit[i] = (int)(y[0] == 'W');
    }
    cin >> a[n];
    vector<long long> cnt[2];
    vector<long long> sa[2];
    for (int b = 0; b < (2); ++b) {
      cnt[b] = vector<long long>(n + 1);
      for (int i = 0; i < (n); ++i)
        cnt[b][i + 1] = cnt[b][i] + (int)(bit[i] == b);
      sa[b] = vector<long long>(n + 1);
      for (int i = 0; i < (n); ++i)
        sa[b][i + 1] = sa[b][i] + (bit[i] == b ? a[i] : 0);
    }
    vector<long long> f(n + 1);
    vector<long long> g1[2];
    vector<long long> g2[2];
    for (int b = 0; b < (2); ++b) {
      g1[b] = vector<long long>(n);
      g2[b] = vector<long long>(n);
    }
    long long min_g1[2] = {1LL << 60, 1LL << 60};
    int p = 0;
    list<int> que[2];
    list<int> que2[2];
    for (int i = 0; i < (n + 1); ++i) {
      f[i] = delta * i;
      for (; (a[i] - a[p]) * cost > delta; ++p)
        for (int b = 0; b < (2); ++b)
          if (bit[p] != b) ckmin(min_g1[b], g1[b][p]);
      for (int b1 = 0; b1 < (2); ++b1)
        if (i == n || bit[i] == b1) {
          int b2 = (b1 ^ 1);
          long long base_cost1 = a[i] * cost + cnt[b1][i] * delta +
                                 cnt[b2][p] * delta +
                                 a[i] * cost * (cnt[b2][i] - cnt[b2][p]) -
                                 cost * (sa[b2][i] - sa[b2][p]);
          ckmin(f[i], base_cost1 + min_g1[b1]);
          long long base_cost2 = a[i] * cost + cnt[b1][i] * delta +
                                 a[i] * cost * cnt[b2][i] - cost * sa[b2][i];
          auto& q = que[b1];
          auto eval = [&](int j) {
            return base_cost2 + g2[b1][j] - a[i] * cost * cnt[b2][j + 1];
          };
          while (((int)q.size()) >= 2) {
            long long t1 = eval(q.front());
            auto it = q.begin();
            ++it;
            long long t2 = eval(*it);
            if (t1 < t2) break;
            q.pop_front();
          }
          if (((int)q.size()) > 0) ckmin(f[i], eval(q.front()));
        }
      if (i < n) {
        for (int b1 = 0; b1 < (2); ++b1) {
          int b2 = (b1 ^ 1);
          g1[b1][i] = f[i] - a[i] * cost - cnt[b1][i + 1] * delta -
                      cnt[b2][i + 1] * delta;
          g2[b1][i] = f[i] - a[i] * cost - cnt[b1][i + 1] * delta +
                      cost * sa[b2][i + 1];
        }
        for (int b1 = 0; b1 < (2); ++b1)
          if (b1 != bit[i]) {
            int b2 = (b1 ^ 1);
            auto slope = [&](int i, int j) {
              return (double)(g2[b1][j] - g2[b1][i]) /
                     (double)(cnt[b2][j + 1] - cnt[b2][i + 1]);
            };
            auto& q = que[b1];
            while (((int)q.size()) >= 2) {
              int last = q.back();
              auto it = q.end();
              --it;
              --it;
              int prev = *it;
              if (slope(prev, last) < slope(prev, i)) break;
              q.pop_back();
            }
            q.push_back(i);
            que2[b1].push_back(i);
          }
      }
    }
    cout << f[n] << endl;
    break;
  }
  return 0;
}
