#include <bits/stdc++.h>
using namespace std;
int N, X, Y, T, A[500005 * 2], Sum[500005 * 2];
char s[500005];
void Init() {
  scanf("%d%d%d%d", &N, &X, &Y, &T);
  scanf("%s", s);
  for (int i = 1; i <= N; i++) {
    A[i] = (s[i - 1] == 'h') ? 1 : Y + 1;
  }
  for (int i = 1; i <= N; i++) A[N + i] = A[i];
  return;
}
int Ans;
void work() {
  if (A[N + 1] > T) {
    printf("0\n");
    return;
  }
  Ans = 1;
  int L = N + 1, R = N + 1;
  Sum[N + 1] = A[N + 1];
  for (int i = N; i > 1; i--) {
    Sum[i] = Sum[i + 1] + A[i];
    if (Sum[i] + (N + 1 - i) * X <= T) L = i;
  }
  for (int i = N + 2; i <= 2 * N; i++) {
    Sum[i] = Sum[i - 1] + A[i];
    if (Sum[i] + (i - N - 1) * X <= T) R = i;
  }
  Ans = max(N + 1 - L + 1, R - N);
  int now = R;
  for (int i = N + 1; i > 1; i--) {
    while ((Sum[i] + Sum[now] - Sum[N + 1] + 2 * X * (N + 1 - i) +
                    X * (now - N - 1) >
                T ||
            now - i + 1 > N))
      if (now >= N + 1)
        now--;
      else
        break;
    if (now < N + 1) break;
    Ans = max(Ans, now - i + 1);
  }
  now = L;
  for (int i = N + 1; i <= 2 * N; i++) {
    while ((Sum[i] + Sum[now] - Sum[N + 1] + 2 * X * (i - N - 1) +
                    X * (N + 1 - now) >
                T ||
            i - now + 1 > N))
      if (now <= N + 1)
        now++;
      else
        break;
    if (now > N + 1) break;
    Ans = max(Ans, i - now + 1);
  }
  printf("%d\n", Ans);
  return;
}
int main() {
  Init();
  work();
  return 0;
}
