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