#include <bits/stdc++.h>
using namespace std;
long long t[100005], p[100005];
char dr[10];
signed main() {
  long long n, c, d;
  scanf("%lld%lld%lld", &n, &c, &d);
  for (long long i = 1; i <= n; ++i) {
    scanf("%lld%s", &t[i], dr + 1);
    if (dr[1] == 'P')
      p[i] = 1;
    else
      p[i] = 2;
  }
  long long s;
  scanf("%lld", &s);
  long long pr1 = s, pr2 = s;
  long long ans = n * d, sum = 0;
  for (long long i = n; i >= 1; --i) {
    long long j = i;
    long long tp = 0, pr;
    if (p[i] == 1)
      pr = pr2;
    else
      pr = pr1;
    while (j >= 1 && p[j] == p[i]) {
      ans = min(ans, (j - 1) * d + c * (pr - t[j]) + tp + sum);
      tp += min(1ll * d, c * (pr - t[j]));
      --j;
    }
    sum += c * (pr - t[j + 1]);
    for (long long k = j + 2; k <= i; ++k) sum += min(1ll * d, c * (pr - t[k]));
    if (p[i] == 1)
      pr1 = t[j + 1];
    else
      pr2 = t[j + 1];
    i = j + 1;
  }
  printf("%lld", ans);
}
