#include <bits/stdc++.h>
using namespace std;
int n, a, b, T, per[500000], i, resr, res1, resl, res2, numr, numl, posr, posl,
    num, sum;
string k;
int main() {
  freopen("input.txt", "r", stdin);
  scanf("%d %d %d %d", &n, &a, &b, &T);
  cin >> k;
  for (int i = 0; i < n; i++) {
    if (k[i] == 'w') per[i] = b;
    per[i]++;
  }
  sum = per[0];
  for (int i = 1; i < n; i++) sum += a + per[i];
  if (sum <= T) {
    printf("%d\n", n);
    return 0;
  }
  for (int i = 0; i < n; i++) {
    resr += per[i];
    if (i) resr += 2 * a;
    if (resr <= T)
      numr++;
    else {
      if (i) resr -= 2 * a;
      resr -= per[i];
      break;
    }
  }
  for (int i = n; i > 0; i--) {
    resl += per[i % n];
    if ((i % n)) resl += 2 * a;
    if (resl <= T)
      numl++;
    else {
      if (i) resl -= 2 * a;
      resl -= per[i];
      break;
    }
  }
  posr = numr - 1;
  posl = n - numl + 1;
  num = max(numr, numl);
  for (int i = n - 1; i > 0; i--) {
    while (per[i] + a + resr > T && posr) {
      resr -= per[posr];
      resr -= 2 * a;
      posr--;
      numr--;
    }
    if (per[i] + a + resr > T) break;
    resr += per[i] + a;
    numr++;
    num = max(numr, num);
  }
  for (int i = 1; i < n; i++) {
    while (per[i] + a + resl > T && posl != n) {
      resl -= per[posl];
      resr -= 2 * a;
      posl++;
      numl--;
    }
    if (per[i] + a + resl > T) break;
    resl += per[i] + a;
    numl++;
    num = max(numl, num);
  }
  printf("%d\n", num);
}
