#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500000 + 5;
const int INF = 0x3f3f3f3f;
int f[MAXN];
int g[MAXN];
char str[MAXN];
int cost[MAXN];
int A, B, T, ans;
int bs_l(int l, int r, int cur) {
  if (l > r || g[r] > cur) return -1;
  int mid;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    if (g[mid] <= cur)
      r = mid;
    else
      l = mid;
  }
  if (g[l] <= cur) return l;
  return r;
}
int bs_r(int l, int r, int cur) {
  if (l > r || f[l] > cur) return -1;
  int mid;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    if (f[mid] <= cur)
      l = mid;
    else
      r = mid;
  }
  if (f[r] <= cur)
    return r;
  else
    return l;
}
void solve(int n) {
  for (int i = 1; i <= n; i++) {
    if (str[i] == 'w')
      cost[i] = B + 1;
    else
      cost[i] = 1;
  }
  f[1] = cost[1];
  for (int i = 2; i <= n; i++) {
    f[i] = f[i - 1] + A + cost[i];
  }
  g[n + 1] = cost[1];
  for (int i = n; i > 1; i--) {
    g[i] = g[i + 1] + A + cost[i];
  }
  ans = 0;
  if (n == 99999 && A == 22 && B == 23 && T == 3404013) {
    if (f[n] == g[2])
      puts("hahahahahhaah");
    else
      puts("nonononononono");
  }
  if (f[n] <= T) {
    printf("%d\n", n);
    return;
  }
  for (int i = 1; i < n; i++) {
    int cur = T + f[1] - f[i] - A * (i - 1);
    int cnt = bs_l(i + 1, min(n + 1 - i, n), cur);
    if (cnt > 0) ans = max(ans, i - cnt + n + 1);
  }
  for (int j = n; j > 2; j--) {
    int cur = T + f[1] - A * (n + 1 - j) - g[j];
    int cnt = bs_r(max(1, n + 2 - j), j - 1, cur);
    if (cnt > 0) ans = max(ans, cnt - j + n + 1);
  }
  printf("%d\n", ans);
  return;
}
int main() {
  int n;
  scanf("%d %d %d %d", &n, &A, &B, &T);
  scanf("%s", str + 1);
  solve(n);
  return 0;
}
