#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, T, i = 0;
  long long sum = -1;
  cin >> n >> a >> b >> T;
  string arr;
  cin >> arr;
  if (b < T) {
    while (sum < T && i < n) {
      if (arr[i] == 'h')
        sum += (1 + a);
      else
        sum += (1 + a + b);
      i++;
    }
  }
  cout << i << endl;
  return 0;
}
