#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
int main() {
  int n, a, b, t;
  scanf("%d%d%d%d", &n, &a, &b, &t);
  char s[MAXN];
  gets(s);
  gets(s);
  int front[MAXN], backArray[MAXN];
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      front[i] = 1;
      if (s[i] == 'w') front[i] += b;
    } else {
      front[i] = 1;
      if (s[i] == 'w') front[i] += b;
      front[i] += a;
      front[i] += front[i - 1];
    }
  }
  int j = 0;
  for (int i = n - 1; i >= 0; i--) {
    backArray[j] = 1;
    if (s[j] == 'w') backArray[j] += b;
    backArray[j] += a;
    if (j != 0) backArray[j] += backArray[j - 1];
    j++;
  }
  int result = 0;
  for (int i = 0; i <= n; i++) {
    int frontSegment = 0;
    if (i != 0) frontSegment = front[i - 1];
    int l = 0, r = n - i;
    while (r - l > 60) {
      int m = l + (r - l) / 2;
      int value = frontSegment;
      if (i != 0) value += a * i;
      if (m != 0) value += backArray[m - 1];
      if (value <= t)
        l = m;
      else
        r = m;
    }
    int count = l;
    for (int k = l; k <= r; k++) {
      int value = frontSegment;
      if (i != 0) value += a * i;
      if (k != 0) value += backArray[k - 1];
      if (value <= t) count = k;
    }
    int value = frontSegment;
    if (i != 0) value += a * i;
    if (count != 0) value += backArray[count - 1];
    if (value <= t) result = max(result, i + count);
  }
  printf("%d", result);
  return 0;
}
