#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
bool type[maxn];
int front[maxn];
int main() {
  int n, a, b, t;
  scanf("%d%d%d%d", &n, &a, &b, &t);
  char c;
  scanf("%c", &c);
  for (int i = 1; i <= n; i++) {
    scanf("%c", &c);
    type[i] = (c == 'w');
    front[i] = front[i - 1] + type[i];
  }
  int ans = 0;
  for (int i = 2; i <= n + 1; i++) {
    int num = (n - i + 1);
    int least = (front[n] - front[i - 1]) * b + num * (a + 1) + b * type[1] + 1;
    if (least > t) continue;
    int l = 1, r = i - 1;
    while (l < r) {
      int mid = (l + r + 1) / 2;
      int need = least + (front[mid] - front[1]) * b + (mid - 1) * (a + 1) +
                 min(num, mid - 1) * a;
      if (need > t)
        r = mid - 1;
      else
        l = mid;
    }
    ans = max(ans, num + l);
  }
  printf("%d\n", ans);
  return 0;
}
