#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
char s[MAXN];
int L[MAXN], R[MAXN];
int main() {
  int n, a, b, t;
  while (~scanf("%d%d%d%d%s", &n, &a, &b, &t, s)) {
    int ans = 0;
    vector<int> V1, V2;
    L[0] = s[0] == 'w' ? b + 1 : 1;
    if (L[0] <= t) ans = 1;
    for (int i = 1; i < n; i++) {
      L[i] = L[i - 1] + a + (s[i] == 'w' ? b + 1 : 1);
      V1.push_back(L[i]);
      if (L[i] <= t) {
        ans = max(ans, i + 1);
      }
    }
    R[0] = s[0] == 'w' ? b + 1 : 1;
    for (int i = n - 1; i >= 1; i--) {
      R[i] = R[(i + 1) % n] + a + (s[i] == 'w' ? b + 1 : 1);
      V2.push_back(R[i]);
      if (R[i] <= t) {
        ans = max(ans, n - i + 1);
      }
    }
    for (int i = 1; i < n; i++) {
      if (L[i] + i * a > t) continue;
      int left = t - L[i] - i * a + L[0];
      int pos = upper_bound(V2.begin(), V2.end(), left) - V2.begin();
      if (left >= 0) {
        ans = max(ans, i + 1 + pos);
      }
    }
    for (int i = n - 1; i >= 1; i--) {
      if (R[i] + (n - i) * a > t) continue;
      int left = t - R[i] - (n - i) * a + L[0];
      int pos = upper_bound(V1.begin(), V1.end(), left) - V1.begin();
      if (left >= 0) {
        ans = max(ans, n - i + 1 + pos);
      }
    }
    ans = min(ans, n);
    printf("%d\n", ans);
  }
  return 0;
}
