#include <bits/stdc++.h>
using namespace std;
const int maxn = 500000 + 100;
string pho;
int suml[maxn], sumr[maxn];
int n, a, b, t;
int main() {
  while (~scanf("%d%d%d%d", &n, &a, &b, &t)) {
    cin >> pho;
    suml[0] = 0;
    for (int i = 0; i < n; i++) {
      if (pho[i] == 'w') {
        suml[i] = (i == 0 ? 0 : suml[i - 1]) + (i == 0 ? 0 : a) + b + 1;
      } else if (pho[i] == 'h') {
        suml[i] = (i == 0 ? 0 : suml[i - 1]) + (i == 0 ? 0 : a) + 1;
      }
    }
    reverse(pho.begin() + 1, pho.end());
    for (int i = 0; i < n; i++) {
      if (pho[i] == 'w') {
        sumr[i] = (i == 0 ? 0 : sumr[i - 1]) + (i == 0 ? 0 : a) + b + 1;
      } else if (pho[i] == 'h') {
        sumr[i] = (i == 0 ? 0 : sumr[i - 1]) + (i == 0 ? 0 : a) + 1;
      }
    }
    int ans = 0, anst, rev;
    for (int i = 0; i < n; i++) {
      rev = t - suml[i] - a * i;
      if (rev < 0) continue;
      anst = lower_bound(sumr, sumr + n, rev + sumr[0]) - sumr;
      if (sumr[anst] > rev + sumr[0]) anst--;
      if (anst + i + 1 > n) anst = n - i - 1;
      ans = max(ans, i + 1 + anst);
    }
    for (int i = 0; i < n; i++) {
      rev = t - sumr[i] - a * i;
      if (rev < 0) continue;
      anst = lower_bound(suml, suml + n, rev + sumr[0]) - suml;
      if (suml[anst] > rev + suml[0]) anst--;
      if (anst + i + 1 > n) anst = n - i - 1;
      ans = max(ans, i + 1 + anst);
    }
    printf("%d\n", ans);
  }
  return 0;
}
