#include <bits/stdc++.h>
using std::min;
long long n, A, B, t[200100], nxt[2], flag[200100], ans;
char s[10];
signed main() {
  scanf("%lld%lld%lld", &n, &A, &B);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld%s", &t[i], s);
    if (s[0] == 'P')
      flag[i] = 1;
    else
      flag[i] = 0;
  }
  scanf("%lld", &nxt[1]);
  nxt[0] = nxt[1];
  long long sum = 0;
  ans = n * B;
  for (long long i = n; i >= 1; i--) {
    if (flag[i] != flag[i - 1]) {
      sum += A * (nxt[flag[i] ^ 1] - t[i]);
      nxt[flag[i]] = t[i];
    } else
      sum += min(A * (nxt[flag[i] ^ 1] - t[i]), B);
    ans = min(ans, sum + (i - 1) * B);
  }
  printf("%lld\n", ans);
}
