#include <bits/stdc++.h>
using namespace std;
int n, a, b, t;
bool dir[500500];
int dis[500500][2];
int cst[500500][2];
int main() {
  scanf("%d%d%d%d\n", &n, &a, &b, &t);
  for (int i = 0; i < n; i++) {
    char tmp = getchar();
    dir[i] = tmp == 'w';
  }
  int lb = -1, rb = -1;
  cst[0][0] = cst[0][1] = cst[n][0] = cst[n][1] = b * dir[0] + 1;
  if (cst[0][0] > t) {
    puts("0");
    return 0;
  }
  for (int i = 1; i < n - 1; i++) {
    dis[i][0] = dis[i - 1][0] + a;
    cst[i][0] = cst[i - 1][0] + b * dir[i] + 1;
    if (rb == -1 && dis[i][0] + cst[i][0] > t) rb = i - 1;
    dis[n - i][1] = dis[n - i + 1][1] + a;
    cst[n - i][1] = cst[n - i + 1][1] + b * dir[n - i] + 1;
    if (lb == -1 && dis[n - i][1] + cst[n - i][1] > t) lb = i - 1;
  }
  if (lb == -1 && rb == -1) {
    printf("%d\n", n);
    return 0;
  }
  int ans = max(lb, rb) + 1;
  lb = 0;
  while (rb > 0) {
    while (dis[rb][0] + cst[rb][0] + dis[n - lb][1] + cst[n - lb][1] +
               min(dis[rb][0], dis[n - lb][1]) - cst[0][0] <=
           t)
      lb++;
    lb--;
    ans = max(ans, lb + rb + 1);
    rb--;
  }
  printf("%d\n", ans);
}
