#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const int N = 505000;
int n, a, b, t;
char str[N * 2];
inline int calc(int pos) { return (str[pos] == 'w') * b + 1 + a; }
int main() {
  int i, l, r;
  scanf("%d%d%d%d", &n, &a, &b, &t);
  scanf("%s", str + 1);
  for (i = 1; i <= n; i++) str[i + n] = str[i];
  l = 2;
  int s = -1 - a;
  for (r = 2; r <= l + n - 1; r++) {
    s += calc(r);
    if (s > t) {
      s -= calc(r);
      break;
    }
  }
  int ans = 0;
  for (l = 2; l <= n + 1; l++) {
    for (; r <= l + n - 1; r++) {
      s += calc(r);
      if (s > t) {
        s -= calc(r);
        break;
      }
    }
    if (r > n + 1) {
      ans = max(ans, r - l);
    }
    s -= calc(l);
  }
  cout << ans << endl;
}
