#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
char s[maxn];
long long t1[maxn] = {0}, t2[maxn] = {0};
int main() {
  int n, a, b, t;
  scanf("%d%d%d%d", &n, &a, &b, &t);
  scanf("%s", s + 1);
  memset(t1, 0x3f3f3f3f, sizeof(t1));
  memset(t2, 0x3f3f3f3f, sizeof(t2));
  t1[0] = 0;
  int ans = 0;
  for (int i = 1; i < n + 1; i++) {
    t1[i] = t1[i - 1];
    if (i != 1) t1[i] += a;
    if (s[i] == 'w') t1[i] += b;
    t1[i]++;
    if (t1[i] > t) break;
    ans = i;
  }
  t2[1] = t1[1];
  int sum = 0;
  if (ans) sum = 1;
  if (n != 1) {
    t2[n] = t2[1] + a;
    if (s[n] == 'w') {
      t2[n] += b;
    }
    t2[n]++;
    if (t2[n] <= t) sum++;
  }
  for (int i = n - 1; i > 1; i--) {
    t2[i] = t2[i + 1];
    t2[i] += a;
    if (s[i] == 'w') t2[i] += b;
    t2[i]++;
    if (t2[i] > t) break;
    sum++;
  }
  ans = max(ans, sum);
  int hx = 2;
  for (int i = 1; i <= n; i++) {
    int te = t1[i] + t2[hx] + min(i - 1, n - hx + 1) * a - t1[1];
    while (hx <= n && te > t) {
      hx++;
      te = t1[i] + t2[hx] + min(i - 1, n - hx + 1) * a - t1[1];
    }
    if (hx <= n && te <= t) ans = max(ans, i + n - hx + 1);
  }
  if (ans > n) ans = n;
  printf("%d\n", ans);
}
