#include <bits/stdc++.h>
using namespace std;
string s;
int lc[1000000], rc[1000000];
int main() {
  int n, a, b, t;
  cin >> n >> a >> b >> t;
  cin >> s;
  for (int i = 0; i < n; ++i) {
    lc[i + 1] = lc[i] + (s[i] == 'w' ? 1 : 0);
    rc[n - i] = rc[n - i + 1] + (s[n - 1 - i] == 'w' ? 1 : 0);
  }
  if (t >= (n - 1) * a + rc[1] * b + n) {
    cout << n << endl;
    return 0;
  }
  int ans = 0;
  for (int i = 1; i < n - 1; ++i) {
    int l = i + 2;
    int r = n + 1;
    while (l < r) {
      int m = (l + r) / 2;
      if ((rc[m] + lc[i]) * b +
              ((i - 1) + (n - m + 1) + min(i - 1, n - m + 1)) * a + i + n - m +
              1 <=
          t) {
        r = m;
      } else {
        l = m + 1;
      }
    }
    if ((rc[r] + lc[i]) * b +
            ((i - 1) + (n - r + 1) + min(i - 1, n - r + 1)) * a + i + n - r +
            1 <=
        t) {
      ans = max(ans, i + n - r + 1);
    }
  }
  cout << ans << endl;
  return 0;
}
