#include <bits/stdc++.h>
using namespace std;
const int max_n = 5e5;
struct data {
  int time_left;
  int seen_photos;
  int time_spent_going_to_left;
};
data one[max_n];
bool position[max_n];
int n, a, b, t;
int time_spent_watching_i(int i) {
  int answer = 0;
  if (i > 0) answer += a + 1;
  if (position[i]) answer += b;
  return answer;
}
int main() {
  cin >> n >> a >> b >> t;
  for (int i = 0; i < n; i++) {
    char x;
    cin >> x;
    if (x == 'h')
      position[i] = false;
    else
      position[i] = true;
  }
  for (int i = 0; i < n; i++) {
    one[i].time_left = t;
    one[i].seen_photos = 0;
    one[i].time_spent_going_to_left = 0;
  }
  for (int i = 0; i < n && one[0].time_left > 0; i++) {
    if (one[0].time_left >= time_spent_watching_i(i)) {
      one[0].time_left -= time_spent_watching_i(i);
      one[0].seen_photos++;
    } else
      break;
  }
  if (one[0].seen_photos == n) {
    cout << n << endl;
    return 0;
  }
  for (int i = 1; i < n; i++) {
    if (t - one[i - 1].time_spent_going_to_left >=
        time_spent_watching_i(n - i - 1)) {
      one[i].time_spent_going_to_left = one[i - 1].time_spent_going_to_left +
                                        time_spent_watching_i(n - i - 1);
      one[i].seen_photos = i + 1;
      one[i].time_left = t - one[i].time_spent_going_to_left;
      one[i].time_left -= a * i;
      one[i].seen_photos += one[i - 1].seen_photos - i - 1;
      one[i].time_left -=
          t - one[i - 1].time_left - one[i - 1].time_spent_going_to_left;
      while (one[i].time_left < 0) {
        int index = one[i].seen_photos - i - 1;
        one[i].time_left += time_spent_watching_i(index);
        one[i].seen_photos--;
      }
    } else
      break;
  }
  int max_seen = 0;
  for (int i = 0; i < n; i++) {
    if (one[i].seen_photos > max_seen) max_seen = one[i].seen_photos;
  }
  cout << max_seen << endl;
  return 0;
}
