#include <bits/stdc++.h>
using namespace std;
long long upTo[500005];
long long p, swipe, rot, lim;
bool works(int x) {
  long long cost = x + swipe * (x - 1);
  for (int i = 1; i <= x; i++) {
    long long tot = cost + (upTo[i] + upTo[p] - upTo[p - (x - i)]) * rot +
                    swipe * min(i - 1, x - i);
    if (tot <= lim) {
      return true;
    }
  }
  return false;
}
int main() {
  cin >> p >> swipe >> rot >> lim;
  string s;
  cin >> s;
  int c = 0;
  for (int i = 1; i <= p; i++) {
    if (s[i - 1] == 'w') c++;
    upTo[i] = c;
  }
  int start, end, ans;
  start = 0;
  end = p;
  while (true) {
    if (start == end) {
      ans = start;
      break;
    }
    if (start + 1 == end) {
      if (works(end))
        ans = end;
      else
        ans = start;
      break;
    }
    int mid = (start + end) / 2;
    if (works(mid))
      start = mid;
    else
      end = mid;
  }
  cout << ans << endl;
  return 0;
}
