#include <bits/stdc++.h>
using namespace std;
int n, a, b, T;
char req[500005];
bool judge(int l) {
  int lcnt = 0, rcnt = l - 1;
  int cost = (l - 1) * a;
  for (int i = int(0); i < int(l); i++) {
    cost++;
    if (req[i] == 'w') cost += b;
  }
  if (cost <= T) return true;
  for (int i = -1; i > -l; i--) {
    lcnt++, rcnt--;
    if (req[i + l] == 'w') cost -= b;
    if (req[i + n] == 'w') cost += b;
    if (cost + a * min(lcnt, rcnt) <= T) return true;
  }
  return false;
}
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &T);
  for (int i = int(0); i < int(n); i++) scanf(" %c", req + i);
  int l = 1, r = n, ans = 0;
  while (l <= r) {
    int mid = l + r >> 1;
    if (judge(mid)) {
      l = mid + 1;
      ans = mid;
    } else {
      r = mid - 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
