#include <bits/stdc++.h>
using namespace std;
int n, a, b;
long long int T;
long long int cost[1100000];
char S[1100000];
int main() {
  scanf("%d%d%d%I64d", &n, &a, &b, &T);
  scanf("%s", S + 1);
  for (int i = 1; i <= n; i++)
    cost[i] = cost[i - 1] + (long long int)b * (S[i] == 'w');
  for (int i = 1; i <= n; i++)
    cost[i + n] = cost[i + n - 1] + (long long int)b * (S[i] == 'w');
  int maxans = 0;
  for (int L = n + 1; L >= 2; L--) {
    int lowerBound = n + 1 - L + 1, upperBound = n, ans = -1;
    while (lowerBound <= upperBound) {
      int mid = (lowerBound + upperBound) >> 1;
      int R = L + mid - 1;
      long long int nowcost =
          (long long int)a * (long long int)(n + 1 - L + R - L) + cost[R] -
          cost[L - 1] + (R - L + 1);
      if (nowcost <= T) {
        ans = mid;
        lowerBound = mid + 1;
      } else
        upperBound = mid - 1;
    }
    maxans = max(maxans, ans);
  }
  for (int R = n + 1; R <= n + n; R++) {
    int lowerBound = R - (n + 1) + 1, upperBound = n, ans = -1;
    while (lowerBound <= upperBound) {
      int mid = (lowerBound + upperBound) >> 1;
      int L = R - mid + 1;
      long long int nowcost =
          (long long int)a * (long long int)(R - (n + 1) + R - L) + cost[R] -
          cost[L - 1] + (R - L + 1);
      if (nowcost <= T) {
        ans = mid;
        lowerBound = mid + 1;
      } else
        upperBound = mid - 1;
    }
    maxans = max(maxans, ans);
  }
  printf("%d\n", maxans);
  return 0;
}
