#include <bits/stdc++.h>
using namespace std;
long long n, a, b, t;
long long arr[500005];
char pos[500005];
long long curSum[500005];
long long opSum[500005];
int main() {
  cin >> n >> a >> b >> t;
  for (long long i = 0; i < n; i++) scanf("%I64d", &arr[i]);
  for (long long i = 0; i < n; i++) scanf(" %c", &pos[i]);
  curSum[0] = b * (pos[0] == 'w') + 1;
  for (long long i = 1; i < n; i++)
    curSum[i] = curSum[i - 1] + a + 1 + b * (pos[i] == 'w');
  opSum[n - 1] = 1 + b * (pos[n - 1] == 'w');
  for (long long i = n - 2; i >= 0; i--)
    opSum[i] = opSum[i + 1] + a + 1 + b * (pos[i] == 'w');
  long long curMax = 0;
  for (long long i = 0; i < n; i++) {
    if (curSum[i] > t) break;
    long long curT = t - curSum[i];
    curMax = max(curMax, i + 1LL);
    curT -= (i + 1) * a;
    if (curT < 0) continue;
    if (i == n - 1) break;
    long long low = i + 1, high = n - 1;
    while (low < high) {
      long long mid = low + ((high - low) / 2);
      if (opSum[mid] > curT)
        low = mid + 1;
      else
        high = mid;
    }
    if (opSum[low] > curT) continue;
    curMax = max(curMax, i + 1 + (n - low));
  }
  for (long long i = 0; i < n - 1; i++) {
    long long dVal = opSum[n - i - 1] + a + curSum[0];
    if (dVal > t) break;
    long long curT = t - dVal;
    curMax = max(curMax, i + 2LL);
    curT -= (i + 1) * a;
    if (curT < 0) continue;
    if (i == n - 1) break;
    long long low = 1, high = n - i - 2;
    if (low > high) continue;
    while (low < high - 1) {
      long long mid = low + ((high - low) / 2);
      if (curSum[mid] - curSum[0] > curT)
        high = mid - 1;
      else
        low = mid;
    }
    if (curSum[high] - curSum[0] <= curT)
      curMax = max(curMax, i + 2 + high);
    else if (curSum[low] - curSum[0] <= curT)
      curMax = max(curMax, i + 2 + low);
  }
  cout << curMax << endl;
  return 0;
}
