#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 10e5 + 100;
int arr[MAXN];
int arr1[MAXN];
int arr2[MAXN];
int main() {
  int n, a, b, T;
  while (~scanf("%d %d %d %d", &n, &a, &b, &T)) {
    char c;
    c = getchar();
    for (int i = 0; i < n; i++) {
      c = getchar();
      if (c == 'h')
        arr[i] = 1 + a;
      else
        arr[i] = b + 1 + a;
    }
    arr2[0] = arr1[0] = arr[0] = arr[0] - a;
    int ans1 = 0;
    for (int i = 1; i < n; i++) {
      arr1[i] = arr[i] + arr1[i - 1];
    }
    int k = 0;
    for (int i = n - 1; i >= 1; i--) {
      arr2[k + 1] = arr[i] + arr2[k];
      k++;
    }
    for (int i = 0; i < n; i++) {
      if (arr1[i] <= T) ans1 = i + 1;
    }
    for (int i = 0; i < n; i++) {
      if (arr2[i] <= T) ans1 = ans1 > i + 1 ? ans1 : i + 1;
    }
    for (int i = 1; i < n && arr1[i] < T; i++) {
      int t = T - arr1[i] - a * i;
      int total = upper_bound(arr2, arr2 + n, t) - arr2 + i;
      if (total > n) total = n;
      ans1 = ans1 > total ? ans1 : total;
    }
    for (int i = 1; i < n && arr2[i] < T; i++) {
      int t = T - arr2[i] - a * i;
      int total = upper_bound(arr1, arr1 + n, t) - arr1 + i;
      if (total > n) total = n;
      ans1 = ans1 > total ? ans1 : total;
    }
    printf("%d\n", ans1);
  }
  return 0;
}
