#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int N = 5e5 + 10, INF = 0x3f3f3f3f, MOD = 1e9 + 7;
int n, a, b, T;
int pre[N], suf[N];
char s[N];
int main() {
  ios_base::sync_with_stdio(0);
  while (scanf("%d%d%d%d", &n, &a, &b, &T) == 4) {
    scanf("%s", s + 1);
    pre[0] = suf[n + 1] = 0;
    for (int i = 1; i <= n; ++i) {
      pre[i] = pre[i - 1] + (i == 1 ? 0 : a) + (s[i] == 'w' ? b : 0) + 1;
    }
    for (int i = n; i; --i) {
      suf[i] = suf[i + 1] + a + (s[i] == 'w' ? b : 0) + 1;
    }
    reverse(suf + 1, suf + 1 + n);
    int ans = 0;
    for (int i = 1; i <= n; ++i) {
      if (pre[i] > T) break;
      int leave = T - pre[i] - (i - 1) * a;
      int can = upper_bound(suf + 1, suf + 1 + n, leave) - suf - 1;
      ans = max(ans, min(i + can, n));
    }
    printf("%d\n", ans);
  }
  return 0;
}
