#include <bits/stdc++.h>
using namespace std;
char str[500005];
int num[500005];
int n, a, b, t;
int get(int x, int y) {
  return min((x - 1) * a * 2 + (n - y + 1) * a,
             (n - y + 1) * a * 2 + (x - 1) * a);
}
bool erfen(int o) {
  for (int i = 1; i <= o; i++) {
    if (num[i] + num[n] - num[n - o + i] + get(i, n - (o - i) + 1) <= t)
      return true;
  }
  return false;
}
int main() {
  while (~scanf("%d%d%d%d", &n, &a, &b, &t)) {
    num[0] = 0;
    memset(num, sizeof(num), 0);
    scanf("%s", str + 1);
    for (int i = 1; i <= n; i++) {
      int v;
      if (str[i] == 'h')
        v = 1;
      else
        v = 1 + b;
      num[i] = num[i - 1] + v;
    }
    int l = 0;
    int r = n;
    int ans = 0;
    while (l <= r) {
      int mid = (l + r) >> 1;
      if (erfen(mid)) {
        ans = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    printf("%d\n", ans);
  }
}
