#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500000;
char s[MAXN + 10];
int f[MAXN + 10], g[MAXN + 10];
int n, a, b, t;
int main(void) {
  scanf("%d%d%d%d%s", &n, &a, &b, &t, s + 1);
  f[1] = (s[1] == 'w') * b + 1;
  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 j = n + 1;
  int ans = 0;
  for (int i = n; i >= 1; i--) {
    for (; f[i] + g[j - 1] + min(i - 1, n - j + 2) * a <= t && j - 1 > i; j--)
      ;
    if (f[i] + g[j] + min(i - 1, n - j + 1) * a <= t)
      ans = max(ans, i + n - j + 1);
  }
  printf("%d\n", ans);
  return 0;
}
