#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int mof = 1000000007;
const int inf = 1000000010;
const long long llinf = 1000000007000000007;
const double pi = 3.14159265359;
int pref[511111];
int n, a, b, t;
string second;
bool first(int i, int j) {
  int wj = pref[j + 1];
  int wi = pref[n] - pref[i];
  int num = j + (n - i) + 1;
  int hj = j * a;
  int hi = (n - i) * a;
  int all = (num - 1) * a;
  if (min(hi, hj) + (num - 1) * a + num + (wi + wj) * b <= t) return true;
  return false;
}
int main() {
  cin >> n >> a >> b >> t;
  cin >> second;
  pref[0] = 0;
  for (int i = 0; i < n; i++) {
    if (second[i] == 'w')
      pref[i + 1] = pref[i] + 1;
    else
      pref[i + 1] = pref[i];
  }
  if (pref[n] * b + (n - 1) * a + n <= t) {
    cout << n;
    return 0;
  }
  int ans = 0;
  for (int x = 0; x < n; x++) {
    int ws = pref[x + 1];
    int l = x, r = n;
    while (r - l > 1) {
      int m = (r + l) / 2;
      if (first(m, x)) {
        r = m;
      } else {
        l = m;
      }
    }
    if (first(l, x)) {
      ans = max(ans, n - l + x + 1);
    }
    if (first(r, x)) {
      ans = max(ans, n - r + x + 1);
    }
  }
  cout << min(n, ans);
}
