#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500100;
int n, pref[MAXN], suff[MAXN], a, b, t;
char s[MAXN];
int sol;
int main() {
  scanf("%d %d %d %d", &n, &a, &b, &t);
  scanf("%s", s);
  for (int i = 0, j = 1; j <= n; j++, i--) {
    if (i < 0) i += n;
    pref[j] = pref[j - 1] + 1;
    if (s[i] == 'w') pref[j] += b;
    if (j > 1) pref[j] += a;
    if (pref[j] <= t) sol = max(sol, j);
  }
  for (int i = 0, j = 1; j <= n; j++, i++) {
    suff[j] = suff[j - 1] + 1;
    if (s[i] == 'w') suff[j] += b;
    if (j > 1) suff[j] += a;
    if (suff[j] <= t) sol = max(sol, j);
  }
  for (int i = (0); i < int(n + 1); i++) {
    if (!i || pref[i] >= t) continue;
    int t1 = t - pref[i] - (i - 1) * a + 1 + b * (s[0] == 'w');
    if (t1 <= 0) break;
    int in = lower_bound(suff, suff + n + 1, t1) - suff;
    while (suff[in] > t1) in--;
    in = max(in - 1, 0);
    sol = max(sol, min(n, i + in));
  }
  for (int i = (0); i < int(n + 1); i++) {
    if (!i || suff[i] >= t) continue;
    int t1 = t - suff[i] - (i - 1) * a + 1 + b * (s[0] == 'w');
    if (t1 <= 0) break;
    int in = lower_bound(pref + 1, pref + n + 1, t1) - pref;
    while (pref[in] > t1) in--;
    in = max(in - 1, 0);
    sol = max(sol, min(n, i + in));
  }
  printf("%d\n", sol);
  return 0;
}
