#include <bits/stdc++.h>
using namespace std;
int n, a, b, T, ans;
long long v[1 << 20], sum[1 << 20];
string s;
void getans() {
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    long long curt = sum[i] + a * i;
    if (curt <= T)
      ans = max(ans, i + 1);
    else
      return;
    curt += a * i;
    if (curt > T) return;
    int lo = i + 1, hi = n;
    while (lo < hi) {
      int mi = (lo + hi) >> 1;
      if (sum[n - 1] - sum[mi - 1] + a * (n - mi) + curt > T)
        lo = mi + 1;
      else
        hi = mi;
    }
    ans = max(ans, n - lo + i + 1);
  }
}
int main() {
  cin >> n >> a >> b >> T;
  cin >> s;
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n)))
    v[i] = 1 + (s[i] == 'w' ? b : 0);
  sum[0] = v[0];
  for (__typeof(n) i = (1) - ((1) > (n)); i != (n) - ((1) > (n));
       i += 1 - 2 * ((1) > (n)))
    sum[i] = sum[i - 1] + v[i];
  getans();
  reverse(v + 1, v + n);
  for (__typeof(n) i = (1) - ((1) > (n)); i != (n) - ((1) > (n));
       i += 1 - 2 * ((1) > (n)))
    sum[i] = sum[i - 1] + v[i];
  getans();
  cout << ans;
}
