#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
const int N = 5e5 + 5;
int n, a, b, t;
lint w[N];
char s[N];
bool check(int m) {
  for (int i = 1; i <= m; i++) {
    lint sum1 = w[i] + (w[n] - w[n - (m - i)]);
    lint sum2 =
        min((i - 1) * a * 2 + (m - i) * a, (i - 1) * a + (m - i) * a * 2);
    if (sum1 + sum2 <= t) return 1;
  }
  return 0;
}
int main() {
  scanf("%d%d%d%d%s", &n, &a, &b, &t, s + 1);
  for (int i = 1; i <= n; i++) w[i] = w[i - 1] + 1 + (s[i] == 'w' ? b : 0);
  int l = 0, r = n;
  while (l < r) {
    int m = (l + r + 1) / 2;
    if (check(m))
      l = m;
    else
      r = m - 1;
  }
  printf("%d\n", l);
}
