#include <bits/stdc++.h>
using namespace std;
struct node {
  long long r;
  friend bool operator<(node a, node b) { return a.r > b.r; }
};
long long n, m, sum, res, flag;
long long a[1123456], b[1123456], c[1123456];
char s[1123456];
int main() {
  long long i, j, k, kk, cas, T, t, x, y, z, r, l;
  while (scanf("%I64d%I64d%I64d%I64d", &n, &x, &y, &T) != EOF) {
    scanf("%s", s);
    memset(a, 0, sizeof(a));
    for (i = 0; i < n; i++) a[i] = a[i + n] = (s[i] == 'w') ? 1 + y : 1;
    for (i = n, t = 0; i < 2 * n; i++) {
      if (t + a[i] + x * (i - n) > T) break;
      t += a[i];
    }
    r = i - 1;
    l = n;
    z = t;
    res = r - l + 1;
    if (res == n)
      printf("%I64d\n", res);
    else {
      while (res < n && r >= n && l > 0) {
        t = x * min((r - n) * 2 + n - l, (n - l) * 2 + r - n);
        while (t + z <= T && res < n && r >= n && l > 0) {
          res = max(res, r - l + 1);
          l--;
          z += a[l];
          t = x * min((r - n) * 2 + n - l, (n - l) * 2 + r - n);
        }
        z -= a[r];
        r--;
      }
      printf("%I64d\n", res);
    }
  }
  return 0;
}
