#include <bits/stdc++.h>
using namespace std;
const int maxN = 200001;
int N, a, b, T;
int sum[maxN];
long long check(int l, int r) {
  return (long long)(min(l, r) + l + r) * a +
         (sum[N] + sum[r + 1] - sum[N - l]);
}
int main() {
  string s;
  cin >> N >> a >> b >> T;
  cin >> s;
  for (int i = 0; i < N; i++) sum[i + 1] = sum[i] + (s[i] == 'w' ? (b + 1) : 1);
  int ans = 0;
  for (int l = 0; l < N; l++) {
    if (check(l, 0) > T) continue;
    int low = 0, hig = N - 1;
    while (hig - low > 1) {
      int mid = (hig + low) / 2;
      if (check(l, mid) <= T)
        low = mid;
      else
        hig = mid;
    }
    ans = max(ans, l + low + 1);
  }
  cout << ans;
  return 0;
}
