#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 7;
char s[N];
int n, a, b, T, f[N], g[N], cc1, ans = 0;
bool pan(int i, int pos) { return f[i] + cc1 + a * (i - 1) + g[pos] <= T; }
void solve() {
  cc1 = (s[1] == 'w') * b + 1;
  f[1] = 0;
  for (int i = 2; i <= n; i++) f[i] = f[i - 1] + (s[i] == 'w') * b + 1 + a;
  for (int i = n; i >= 1; i--) g[i] = g[i + 1] + (s[i] == 'w') * b + 1 + a;
  int pos = 2;
  for (int i = 1; i <= n; i++) {
    pos = max(pos, i + 1);
    for (; pos <= n && !pan(i, pos); pos++)
      ;
    if (pan(i, pos)) ans = max(ans, i + (n - pos + 1));
  }
}
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &T);
  scanf("%s", s + 1);
  solve();
  for (int i = 2; i <= (n + 2) / 2; i++) swap(s[i], s[n - i + 2]);
  solve();
  printf("%d\n", ans);
}
