#include <bits/stdc++.h>
using namespace std;
long long n, c, d, ans, now, t[100100], cz[100100], to[100100];
char str[2];
int main() {
  long long i, j;
  cin >> n >> c >> d;
  for (i = 1; i <= n; i++) {
    scanf("%lld%s", &t[i], str);
    cz[i] = (str[0] == 'P' ? 1 : 2);
  }
  cin >> t[n + 1];
  for (i = n; i >= 1; i--) {
    if (cz[i] != cz[i + 1])
      to[i] = t[i + 1] - t[i];
    else
      to[i] = to[i + 1] + t[i + 1] - t[i];
  }
  ans = n * d;
  for (i = n; i >= 1; i--) {
    now += (t[i + 1] - t[i]) * c;
    if (cz[i] == cz[i + 1]) now += min(d, to[i + 1] * c);
    ans = min(ans, now + (i - 1) * d);
  }
  cout << ans;
}
