#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3F3F3F3F;
const int MAXN = 1e6 + 10;
char s[MAXN];
int pre[MAXN];
int n, a, b, t;
int ans;
int main() {
  ans = 0;
  scanf("%d%d%d%d", &n, &a, &b, &t);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; ++i) s[i + n] = s[i];
  for (int i = 1; i <= 2 * n; ++i) pre[i] = pre[i - 1] + (s[i] == 'w');
  for (int i = n + 1; i <= 2 * n; ++i) {
    int tans = a * (i - n - 1) + b * (pre[i] - pre[n]) + i - n;
    if (tans > t) break;
    int l = 2, r = n + 1;
    while (l < r) {
      int m = (l + r) >> 1;
      int tmp = a * (i - m) + b * (pre[n] - pre[m - 1]) + n - m + 1;
      if (tans + tmp <= t)
        r = m;
      else
        l = m + 1;
    }
    ans = max(ans, min(n, i - r + 1));
  }
  for (int i = n + 1; i >= 2; --i) {
    int tans = a * (n - i + 1) + b * (pre[n + 1] - pre[i - 1]) + n + 2 - i;
    if (tans > t) break;
    int l = n + 1, r = 2 * n;
    while (l < r) {
      int m = (l + r + 1) >> 1;
      int tmp = a * (m - i) + b * (pre[m] - pre[n + 1]) + m - n - 1;
      if (tans + tmp <= t)
        l = m;
      else
        r = m - 1;
    }
    ans = max(ans, min(n, l - i + 1));
  }
  printf("%d\n", ans);
  return 0;
}
