#include <bits/stdc++.h>
using namespace std;
void ga(int N, int *A) {
  for (int i(0); i < N; i++) scanf("%d", A + i);
}
char s[(1 << 19)];
int N, a, b, T, X(0), J, I, P, t;
long long S[(1 << 19)];
void sol() {
  J = I = P = t = 0;
  *S = 1 + (*s == 'w' ? b : 0);
  for (int k(1); k < N; k++) S[k] = S[k - 1] + (s[k] == 'w' ? b : 0) + a + 1;
  while (J < N && S[J] <= T) ++J;
  X = J--, I = N - 1, P = *S;
  if (X == N) return;
  while (666) {
    P += 1 + (s[I] == 'w' ? b : 0) + a;
    if (P > T) break;
    X = max(X, N + 1 - I);
    t = T - P - (N - I) * a;
    while (~J && S[J] > t) --J;
    X = max(X, N - I + J + 1);
    --I;
  }
}
int main(void) {
  scanf("%d%d%d%d%s", &N, &a, &b, &T, s);
  sol();
  int b(1), e(N - 1);
  while (b < e) swap(s[b++], s[e--]);
  sol();
  printf("%d\n", X);
  return 0;
}
