#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 1500010;
const long long INF = 1e17;
long long N, C, A;
char str[5];
long long T[MAXN + 1], last[2];
long long sum;
long long fa[MAXN + 1], tp[MAXN + 1];
bool vis[MAXN + 1];
int main() {
  N = read(), C = read(), A = read();
  for (int i = 1; i <= N; i++) {
    T[i] = read();
    scanf("%s", str + 1);
    if (str[1] == 'P')
      tp[i] = 0;
    else
      tp[i] = 1;
  }
  T[N + 1] = read();
  last[0] = last[1] = N + 1;
  for (int i = N; i >= 1; i--) {
    vis[last[tp[i] ^ 1]] = 1;
    fa[i] = last[tp[i] ^ 1];
    last[tp[i]] = i;
  }
  long long ans = INF;
  for (int i = N; i >= 1; i--) {
    if (!vis[i])
      sum += min((T[fa[i]] - T[i]) * C, A);
    else {
      ans = min(ans, i * A + sum);
      sum += ((T[fa[i]] - T[i]) * C);
    }
  }
  ans = min(ans, sum);
  printf("%lld\n", ans);
  return 0;
}
