#include <bits/stdc++.h>
using namespace std;
int t[100005], type[100005];
long long f[100005];
int main() {
  int n;
  long long c1, c2;
  cin >> n >> c2 >> c1;
  for (int i = 1; i <= n; i++) {
    char ch;
    cin >> t[i] >> ch;
    type[i] = (ch == 'P');
  }
  cin >> t[n + 1];
  for (int i = 1, j; i <= n; i = j) {
    for (j = i; j <= n && type[j] == type[i]; j++)
      ;
    for (int k = i + 1; k <= j; k++) f[k] = min(c1, c2 * (t[j] - t[k]));
  }
  for (int i = n; i; i--) f[i] += f[i + 1];
  long long ans = c1 * n;
  for (int i = 1; i <= n; i++)
    ans = min(ans, c1 * (i - 1) + f[i + 1] + c2 * (t[n + 1] - t[i]));
  cout << ans;
  return 0;
}
