#include <bits/stdc++.h>
using namespace std;
int N, gecis, cevir, T;
char yon[500005];
bool all() {
  int t = 0;
  for (int i = 1; i <= N; i++) {
    t++;
    if (yon[i] == 'w') t += cevir;
    if (t > T) return false;
    t += gecis;
  }
  return true;
}
int main() {
  int yaz;
  cin >> N >> gecis >> cevir >> T;
  for (int i = 1; i <= N; i++) {
    scanf(" %c", yon + i);
  }
  if (all()) {
    printf("%d\n", N);
    return 0;
  }
  int p = N + 1, t = 0, maxx = 0;
  for (int i = 1; i <= N; i++) {
    t++;
    if (yon[i] == 'w') t += cevir;
    while (t + min(N - p + 1, i - 1) * gecis > T && p <= N) {
      t--;
      t -= gecis;
      if (yon[p] == 'w') t -= cevir;
      p++;
    }
    while (p <= N && p <= i) {
      t--;
      t -= gecis;
      if (yon[p] == 'w') t -= cevir;
      p++;
    }
    while (t + min(N - p + 1, i - 1) * gecis < T && p - 1 > i) {
      p--;
      t++;
      t += gecis;
      if (yon[p] == 'w') t += cevir;
      if (t + min(N - p + 1, i - 1) * gecis > T) {
        p++;
        t--;
        t -= gecis;
        if (yon[p - 1] == 'w') t -= cevir;
        break;
      }
    }
    if (t + min(N - p + 1, i - 1) * gecis > T) break;
    maxx = max(maxx, i + N - p + 1);
    t += gecis;
  }
  cout << maxx << endl;
  return 0;
}
