#include <bits/stdc++.h>
using namespace std;
int n, a, b, T, s[500005 << 1];
char ch[500005];
int main() {
  scanf("%d%d%d%d%s", &n, &a, &b, &T, &ch);
  int sum = 0;
  for (int i = 0; i < n; i++) {
    if (ch[i] == 'w')
      s[i] = s[i + n] = b + 1;
    else
      s[i] = s[i + n] = 1;
    sum += s[i];
  }
  if (T < s[0]) {
    printf("0\n");
    return 0;
  }
  sum -= s[0];
  int l = 1, r = n, ans = 0;
  while (l <= n && r < 2 * n) {
    sum += s[r++];
    while (r - l > n || sum + (r - l - 1 + min(r - n - 1, n - l)) * a > T)
      sum -= s[l++];
    ans = max(ans, r - l);
  }
  printf("%d", ans);
  return 0;
}
