#include <bits/stdc++.h>
using namespace std;
int n, a, b, t;
char str[500010];
long long cnt[500010];
long long calc(int l, int r) {
  return (long long)((min(l, r) + l + r) * a +
                     (cnt[r + 1] - cnt[n - l] + cnt[n]));
}
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &t);
  scanf(" %s", str);
  for (int i = 0; i < n; i++) {
    cnt[i + 1] = cnt[i] + ((str[i] == 'w') ? (b + 1) : 1);
  }
  int res = 0;
  for (int l = 0; l < n; l++) {
    if (calc(l, 0) > t) continue;
    int le = 0, ri = n - l;
    while (le + 1 < ri) {
      int mi = (le + ri) / 2;
      if (calc(l, mi) <= t) {
        le = mi;
      } else {
        ri = mi;
      }
    }
    res = max(res, le + l + 1);
  }
  cout << res << endl;
  return 0;
}
