#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, t, i, j;
  int a, b;
  string s;
  while (cin >> n >> a >> b >> t) {
    int time = 0;
    for (i = 0; i < n; i++) cin >> s[i];
    for (j = 0; j < n; j++) {
      if (s[j] == 'h') {
        time = time + a;
        if (time > t) break;
      } else {
        time = time + a + b;
        if (time > t) {
          time = time - a - b;
          break;
        }
      }
    }
    cout << j << endl;
  }
  return 0;
}
