#include <bits/stdc++.h>
using namespace std;
int Search(long long int* Arr, long long int Sum, int st, int end) {
  while (st <= end) {
    int mid = st + (end - st) / 2;
    if (Arr[mid] > Sum) end = mid - 1;
    if (Arr[mid] < Sum) {
      if (st == mid) {
        if (Arr[mid + 1] <= Sum)
          return mid + 1;
        else
          return mid;
      }
      st = mid;
    }
    if (Arr[mid] == Sum) return mid;
  }
  return st;
}
int main() {
  int N, a, b;
  long long int T;
  cin >> N >> a >> b >> T;
  int Val[N];
  for (int i = 0; i < N; i++) {
    char ch;
    cin >> ch;
    if (ch == 'w')
      Val[i] = b + 1;
    else
      Val[i] = 1;
  }
  long long int LSum[N];
  long long int RSum[N];
  LSum[0] = RSum[0] = Val[0];
  for (int i = 1; i < N; i++) {
    RSum[i] = a + Val[i] + RSum[i - 1];
    int indx = (N - i) % N;
    LSum[i] = a + Val[indx] + LSum[i - 1];
  }
  int b1, b2;
  int ans = 0;
  for (b1 = 0; b1 < N; b1++) {
    long long int val1 = LSum[b1];
    long long int back = b1 * a;
    long long int remain = T - val1 - back;
    if (remain < 0) continue;
    remain = remain + Val[0];
    int ind2 = Search(RSum, remain, 0, N);
    ans = max(ans, b1 + ind2 + 1);
  }
  for (b2 = 0; b2 < N; b2++) {
    long long int val1 = RSum[b2];
    long long int back = b2 * a;
    long long int remain = T - val1 - back;
    if (remain < 0) continue;
    remain = remain + Val[0];
    int ind2 = Search(LSum, remain, 0, N);
    ans = max(ans, b2 + ind2 + 1);
  }
  ans = min(ans, N);
  cout << ans << endl;
}
