#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, a, b, T;
  cin >> n >> a >> b >> T;
  vector<int> pref(n);
  vector<int> suf(n);
  char c;
  for (int i = 0; i < n; i++) {
    cin >> c;
    pref[i] = a + (c == 'w') * b;
    pref[i] += (i ? pref[i - 1] : 0);
  }
  for (int i = 0; i < n; i++) {
    suf[i] = pref[n - 1] - (i ? pref[i - 1] : 0);
  }
  int j = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int r = 0;
    if (i < 0) {
      r = 0;
    } else {
      r = pref[i];
      if (r > T) {
        break;
      }
      while (j < n) {
        if (r + suf[j] > T) {
          j++;
        } else {
          break;
        }
      }
      ans = max(ans, min(n, i + 1 + n - j));
    }
  }
  cout << ans << '\n';
}
