#include <bits/stdc++.h>
using namespace std;
long long T, a, b;
long long t[500005];
int main() {
  int n;
  cin >> n >> a >> b >> T;
  string s;
  cin >> s;
  bool o[500005] = {0};
  for (long long i = 0; i < n; i++) o[i] = (s[i] == 'w');
  T -= (1 + o[0] * b);
  long long mx = 0;
  for (int i = 1; i < n; i++) t[i] += t[i - 1] + a + 1 + o[i] * b;
  for (long long i = 0; i < n; i++) {
    if (i) T -= (o[n - i] * b + a + 1);
    if (T >= 0) {
      long long l = 0, r = n - i - 1;
      while (l < r) {
        long long mid = (l + r + 1) / 2;
        if (t[mid] <= T - a * min(i, mid))
          l = mid;
        else
          r = mid - 1;
      }
      mx = max(mx, l + i + 1ll);
    }
  }
  cout << mx;
}
