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