#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, t, count = 0;
  cin >> n >> a >> b >> t;
  int tv[n], stv[n], r = n - 1, l = n;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    if (c == 'h')
      tv[i] = 1;
    else
      tv[i] = b + 1;
  }
  stv[0] = tv[0];
  for (int i = 1; i < n; i++) stv[i] = stv[i - 1] + tv[i];
  if (t >= stv[n - 1] + a * (n - 1)) {
    cout << n << endl;
    return 0;
  } else if (t < tv[0]) {
    cout << 0 << endl;
    return 0;
  }
  while (r >= 0 && t < stv[r] + a * r) r--;
  count = r + 1;
  while (r >= 0) {
    int costr = stv[r] + a * r, costl = stv[n - 1] - stv[l - 1] + a * (n - l),
        traverse = min(a * r, a * (n - l));
    while (l >= 1) {
      costl = stv[n - 1] - stv[l - 1] + a * (n - l);
      traverse = min(a * r, a * (n - l));
      if (costr + costl + traverse <= t) {
        count = max(count, r + 1 + n - l);
        l--;
      } else
        break;
    }
    r--;
  }
  cout << count << endl;
  return 0;
}
