#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n, a, b, T, pre[500005];
char ch[500005];
int check(int x) {
  for (int i = 1; i <= x; i++) {
    if (pre[i] + pre[n] - pre[n - (x - i)] +
            min((i - 1) * a * 2 + (x - i) * a, (i - 1) * a + (x - i) * a * 2) <=
        T)
      return 1;
  }
  return 0;
}
int main() {
  n = read();
  a = read();
  b = read();
  T = read();
  scanf("%s", (ch + 1));
  for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] + 1 + (ch[i] == 'w') * b;
  int l = 0, r = n, ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%d\n", ans);
}
