#include <bits/stdc++.h>
using namespace std;
int n, c, d, t[100007], nxt[100007];
char p[100007];
long long s[100007], f[100007];
int find(int i) {
  int res = i, l = i + 1, r = nxt[i] - 1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if ((t[nxt[i]] - t[mid]) * c > d)
      res = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return res;
}
int main() {
  scanf("%d%d%d", &n, &c, &d);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &t[i]);
    char ch = getchar();
    while (ch != 'W' && ch != 'P') ch = getchar();
    p[i] = ch, s[i] = s[i - 1] + t[i];
  }
  scanf("%d", &t[n + 1]);
  int lstw = n + 1, lstp = n + 1;
  for (int i = n; i; --i)
    if (p[i] == 'W')
      nxt[i] = lstp, lstw = i;
    else
      nxt[i] = lstw, lstp = i;
  for (int i = 1; i <= n + 1; ++i) f[i] = 1LL * (i - 1) * d;
  for (int i = 1; i <= n; ++i) {
    int j = find(i);
    f[nxt[i]] = min(f[nxt[i]], f[i] +
                                   (1LL * (nxt[i] - j) * t[nxt[i]] -
                                    (s[nxt[i] - 1] - s[j] + t[i])) *
                                       c +
                                   1LL * (j - i) * d);
  }
  cout << f[n + 1] << endl;
}
