#include <bits/stdc++.h>
using namespace std;
const int maxn = 5 * 1e5 + 8;
int val[maxn];
int main() {
  memset(val, 0, sizeof val);
  int n, a, b, T;
  char ph;
  scanf("%d%d%d%d", &n, &a, &b, &T);
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c", &ph);
    if (i == 0) {
      if (ph == 'w')
        val[0] = b + 1;
      else
        val[0] = 1;
    } else {
      if (ph == 'w')
        val[i] = b + a + 1;
      else
        val[i] = a + 1;
    }
  }
  int l = 0, r = 0, sum = 0;
  int ans = -1;
  while (sum < T && r < n) {
    sum += val[r++];
    if (sum > T) r--;
  }
  ans = max(ans, (r - 0));
  if (ans > n) ans = n;
  if (sum != T) sum -= val[r];
  r--;
  bool first = true;
  while (ans != n && ans != 0) {
    while (sum <= T && -l + r <= n - 1 && l > -n) {
      l--;
      sum += val[(l + n) % n];
      if (-l < r && first)
        sum += a;
      else {
        if (first) {
          sum -= a * (-l - 1);
          sum += a * r;
          first = false;
        }
      }
    }
    if (sum < T) break;
    ans = max(ans, (r - l));
    if (first)
      sum -= val[r];
    else
      sum -= (val[r] + a);
    if (r > 0) r--;
    if (r == 0) break;
  }
  if (r == 0) {
    l = 0, sum = 0;
    sum += val[0];
    while (sum < T && l > -n) {
      l--;
      sum += val[(l + n) % n];
    }
    if (sum == T) l--;
    ans = max(ans, (0 - l));
    if (ans > n) ans = n;
  }
  printf("%d", ans);
  return 0;
}
