#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 1e5 + 1;
char S[MAXN + 1];
int N, a, b, T, cur = 0, ans = 0;
int main() {
  scanf("%d", &N), scanf("%d", &a), scanf("%d", &b), scanf("%d", &T);
  scanf("%s", S);
  int j = N - 1;
  while (j > 0) cur += a + 1 + b * (S[j--] == 'w');
  j++;
  cur -= a;
  for (int i = 0; i < (int)N; i++) {
    cur += a + 1 + b * (S[i] == 'w');
    while (j <= i) cur -= a + 1 + b * (S[j++] == 'w');
    while (j < N && cur + a * min(i, N - j) > T)
      cur -= a + 1 + b * (S[j++] == 'w');
    if (cur + a * min(i, N - j) <= T) ans = max(ans, i + (N - j) + 1);
  }
  printf("%d\n", ans);
}
