#include <bits/stdc++.h>
using namespace std;
int n, a, b, t, dp[1000000 + 10], dp1[1000000 + 10], dp2[1000000 + 10], l, r, c,
    tren, br, maxx;
char c1;
int main() {
  scanf("%d %d %d %d\n", &n, &a, &b, &t);
  for (int i = 1; i <= n; i++) {
    scanf("%c", &c1);
    if (c1 == 'w')
      dp[i] = 1 + a + b;
    else
      dp[i] = 1 + a;
  }
  dp[1] -= a;
  for (int i = 1; i <= n; i++) dp1[i] = dp1[i - 1] + dp[i];
  for (int i = n; i >= 1; i--) dp2[i] = dp2[i + 1] + dp[i];
  for (int i = 1; i <= n; i++) {
    br = i;
    tren = dp1[i];
    if (tren <= t) maxx = max(maxx, i);
    tren += (i - 1) * a;
    l = 0;
    r = n + 1;
    while (r - l > 1) {
      c = (r + l) / 2;
      if (dp2[c] + tren <= t)
        r = c;
      else
        l = c;
    }
    if (dp2[r] + tren <= t) maxx = max(maxx, i + n - r + 1);
  }
  for (int i = 1; i <= n; i++) {
    br = i;
    tren = dp2[n - i + 2];
    if (tren + dp[1] <= t) maxx = max(maxx, i);
    tren += (i - 1) * a;
    l = 0;
    r = n + 1;
    while (r - l > 1) {
      c = (r + l) / 2;
      if (dp1[c] + tren <= t)
        l = c;
      else
        r = c;
    }
    if (dp1[l] + tren <= t) maxx = max(maxx, i + l - 1);
  }
  maxx = min(maxx, n);
  printf("%d\n", maxx);
  return 0;
}
