#include <bits/stdc++.h>
using namespace std;
const int Nmax = 1e5 + 5;
long long dp[Nmax], s[Nmax];
int C, D, n, i, last[10], t[Nmax];
char p[Nmax];
long long best_sol(int x, int y) {
  if (x >= y) return 0;
  int st, dr, mid;
  st = x;
  dr = y - 1;
  while (st <= dr) {
    mid = (st + dr) / 2;
    if ((long long)C * (t[y] - t[mid]) <= D)
      dr = mid - 1;
    else
      st = mid + 1;
  }
  return (long long)D * (dr - x + 1) +
         (long long)C * (t[y] * (y - dr - 1) - s[y - 1] + s[dr]);
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> C >> D;
  for (i = 1; i <= n; ++i) cin >> t[i] >> p[i];
  cin >> t[n + 1];
  for (i = 1; i <= n + 1; ++i) s[i] = s[i - 1] + t[i];
  for (i = 1; i <= n; ++i) p[i] = (p[i] == 'W' ? 0 : 1);
  last[0] = last[1] = n + 1;
  long long ans = (long long)D * n;
  for (i = n; i; --i) {
    int nxt = last[p[i] ^ 1];
    dp[i] = dp[nxt] + best_sol(i + 1, nxt);
    ans = min(
        ans, dp[i] + (long long)D * (i - 1) + (long long)C * (t[n + 1] - t[i]));
    last[p[i]] = i;
  }
  cout << ans << '\n';
  return 0;
}
