#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 10;
const int INF = 2e9;
const double eps = 1e-6;
const double PI = acos(-1);
int n, m, a, b, T, Ans;
int pre[MAXN], suf[MAXN];
char s[MAXN];
template <typename T>
inline bool read(T &a) {
  a = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    a = a * 10 + (c ^ 48);
    c = getchar();
  }
  return a *= f, true;
}
template <typename A, typename... B>
inline bool read(A &x, B &...y) {
  return read(x) && read(y...);
}
signed main() {
  read(n), read(a), read(b), read(T);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; ++i) {
    pre[i] = pre[i - 1] + 1;
    if (i ^ 1) pre[i] += a;
    if (s[i] == 'w') pre[i] += b;
  }
  for (int i = n; i >= 1; --i) {
    suf[i] = suf[i + 1] + 1;
    if (i ^ n) suf[i] += a;
    if (s[i] == 'w') suf[i] += b;
  }
  reverse(suf + 1, suf + n + 1);
  if (pre[n] <= T) return printf("%d\n", n), 0;
  int pos;
  for (int i = 1; i <= n; ++i) {
    int res = T - pre[i] - a * i;
    if (res < 0) break;
    pos = upper_bound(suf + 1, suf + n + 1, res) - suf - 1;
    pos = n - pos + 1;
    if (pos <= n && i < pos) Ans = max(Ans, i + n - pos + 1);
  }
  reverse(suf + 1, suf + n + 1);
  for (int i = n; i >= 1; --i) {
    int res = T - suf[i] - a * (n - i + 1);
    if (res < 0) break;
    pos = upper_bound(pre + 1, pre + n + 1, res) - pre - 1;
    if (pos >= 1 && pos < i) Ans = max(Ans, n - i + pos + 1);
  }
  printf("%d\n", Ans);
  return 0;
}
