#include <bits/stdc++.h>
using namespace std;
int q[1000005];
char c[500005];
int main() {
  int n, a, b, t, ans = 0, s = 0;
  cin >> n >> a >> b >> t >> c;
  for (int i = 0; i < n; i++) {
    if (c[i] == 'w')
      q[i] = q[i + n] = b + 1;
    else
      q[i] = q[i + n] = 1;
    if (i != 0) s += q[i];
  }
  int l = 1, r = n;
  while (l <= n && r < 2 * n) {
    s += q[r];
    r++;
    while (r - l > n || s + (r - l - 1 + min(r - n - 1, n - l)) * a > t) {
      s -= q[l];
      l++;
    }
    ans = max(ans, r - l);
  }
  cout << ans << endl;
  return 0;
}
