#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
struct fast_ios {
  fast_ios() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  };
} fast_ios_;
template <typename T>
bool mmax(T &m, const T q) {
  if (m < q) {
    m = q;
    return true;
  } else
    return false;
}
template <typename T>
bool mmin(T &m, const T q) {
  if (m > q) {
    m = q;
    return true;
  } else
    return false;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (auto v : vec) os << v << ",";
  os << "]";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &pa) {
  os << "(" << pa.first << "," << pa.second << ")";
  return os;
}
int main() {
  lint N, C, D;
  cin >> N >> C >> D;
  vector<pair<lint, char>> V(N);
  for (int i = (0), i_end_ = (N); i < i_end_; i++) {
    cin >> V[i].first >> V[i].second;
  }
  lint LastP, LastW;
  cin >> LastP;
  LastW = LastP;
  lint ret = N * D;
  lint acccost = 0;
  bool last = false;
  lint step = 0;
  for (int i = (N)-1, i_begin_ = (0); i >= i_begin_; i--) {
    if (last and V[i].second != V[i + 1].second) {
      acccost += step * C - D;
    }
    last = false;
    if (V[i].second == 'P') {
      lint lc = C * (LastW - V[i].first);
      step = LastW - V[i].first;
      if (lc > D) last = true;
      acccost += min(D, lc);
      LastP = V[i].first;
    } else {
      lint lc = C * (LastP - V[i].first);
      step = LastP - V[i].first;
      if (lc > D) last = true;
      acccost += min(D, lc);
      LastW = V[i].first;
    }
    mmin(ret, i * D + acccost);
  }
  cout << ret << endl;
}
