#include <bits/stdc++.h>
using namespace std;
const int nmax = 300010;
const int inf = ((long long)1e9);
int n, a, b, T, w[nmax], sum[nmax];
string s;
int get(int l, int r) {
  return (sum[r] - sum[l - 1] + (l != r ? 2 * (r - l) : 0));
}
int main() {
  cin >> n >> a >> b >> T >> s;
  int sum = 0;
  for (int i = 0; i < n; i++)
    sum += w[i] = w[i + n] = (s[i] == 'w' ? b : 0) + 1;
  for (int i = 1; i <= 2 * n; i++) cerr << w[i - 1] << " ";
  cerr << endl;
  int l = 1, r = n;
  sum -= w[0];
  int ans = 0;
  while (l <= n + 1 && r < 2 * n) {
    sum += w[r++];
    while (r - l > n || sum + (r - l - 1 + min(r - 1 - n, n - l)) * a > T)
      sum -= w[l++];
    if (l > n + 1) break;
    cerr << l << " " << r << endl;
    ans = max(ans, r - l);
  }
  cout << ans << endl;
  return 0;
}
