#include <bits/stdc++.h>
using namespace std;
const int size = 500005;
bool f[size];
char str[size];
int n, t, a, b;
int lef[size], righ[size];
int solve() {
  int i;
  for (i = 0; i < n; i++) {
    if (i == 0)
      lef[i] = (f[i] == true ? 0 : b) + 1;
    else
      lef[i] = lef[i - 1] + (f[i] == true ? 0 : b) + 1 + a;
  }
  for (i = n - 1; i >= 0; i--) {
    if (i == n - 1)
      righ[i] = a + (f[i] == true ? 0 : b) + 1;
    else
      righ[i] = righ[i + 1] + (f[i] == true ? 0 : b) + 1 + a;
  }
  int to = 0, tmp = 0;
  for (i = 0; i < n; i++) {
    if (lef[i] > t) break;
    tmp = max(tmp, i + 1);
    int now = i * a + lef[i];
    while (to < n && now + righ[to] > t) to++;
    tmp = max(tmp, min(n, i + 1 + (n - to)));
  }
  return tmp;
}
int main() {
  cin >> n >> a >> b >> t;
  cin >> str;
  int i;
  for (i = 0; i < n; i++) f[i] = (str[i] == 'h' ? true : false);
  int tmp = solve();
  int j;
  for (i = 1, j = n - 1; i < j; i++, j--) swap(f[i], f[j]);
  tmp = max(solve(), tmp);
  cout << tmp << endl;
  return 0;
}
