#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;
  while (sum < T && i < n) {
    if (arr[i] == 'h')
      sum += (1 + a);
    else
      sum += (1 + a + b);
    i++;
  }
  if (sum > T && i < n) i = 0;
  cout << i << endl;
  return 0;
}
