#include <bits/stdc++.h>
using namespace std;
const int maxn = 500050;
int n, a, b, t;
char s[maxn];
int val[maxn << 1];
int sum[maxn << 1];
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &t);
  scanf("%s", s + 1);
  for (register int i = 1; i <= n; i++) {
    val[i] = val[i + n] = (s[i] == 'w' ? b + 1 : 1);
  }
  for (register int i = n; i > 1; i--) {
    sum[i] = sum[i + 1] + val[i];
  }
  for (register int i = n + 2; i <= 2 * n; i++) {
    sum[i] = sum[i - 1] + val[i];
  }
  int ans = 0;
  for (register int i = 2, j = n + 1; i <= n + 1 && j <= n * 2; i++) {
    int res = val[n + 1] + sum[i] + sum[j] +
              min((n + 1) - i, j - (n + 1)) * 2 * a +
              max((n + 1) - i, j - (n + 1)) * a;
    if (res > t) continue;
    while (res <= t) {
      int nex = val[n + 1] + sum[i] + sum[j + 1] +
                min((n + 1) - i, (j + 1) - (n + 1)) * 2 * a +
                max((n + 1) - i, (j + 1) - (n + 1)) * a;
      if (nex <= t) {
        j++;
        res = nex;
      } else
        break;
    }
    if (j > n * 2) {
      j = n * 2;
      ans = max(ans, min(n, j - i + 1));
      break;
    }
    ans = max(ans, min(n, j - i + 1));
  }
  printf("%d\n", ans);
  return 0;
}
