#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int n, a, b;
int cost[maxn], T;
char w[maxn];
int main(int argc, char** argv) {
  scanf("%d%d%d%d%s\n", &n, &a, &b, &T, w);
  int tcost = 0;
  for (int i = 0; i < n; ++i) {
    if (w[i] == 'w')
      cost[i] = cost[n + i] = b + 1;
    else
      cost[i] = cost[n + i] = 1;
    tcost += cost[i];
  }
  if (cost[0] > T) {
    printf("0\n");
    return 0;
  }
  tcost -= cost[0];
  int p = 1, q = n, ans = 0;
  while (p <= n && q < n + n) {
    tcost += cost[q++];
    while (q - p > n || tcost + a * (q - p - 1 + min(q - n - 1, n - p)) > T)
      tcost -= cost[p++];
    ans = max(ans, q - p);
  }
  printf("%d\n", ans);
}
