#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 7;
long long n, a, b, T, ans;
string s;
long long t[N];
long long ile_w[N];
bool check(long long l, long long r) {
  return r - l + 1 + b * (ile_w[r] - ile_w[l - 1]) +
             a * (r - l + min(abs(n + 1 - l), abs(n + 1 - r))) <=
         T;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> a >> b >> T >> s;
  s = '#' + s + s;
  for (long long i = 1; i <= 2 * n; ++i) {
    if (s[i] == 'w') ++ile_w[i];
    ile_w[i] += ile_w[i - 1];
  }
  long long r = n + 1;
  for (long long l = 2; l <= n + 1; ++l) {
    while (r - l + 1 < n && check(l, r + 1)) ++r;
    if (check(l, r)) ans = max(ans, r - l + 1);
  }
  cout << ans << '\n';
}
