#include <bits/stdc++.h>
using namespace std;
const int N = 500011;
long long pre[N], post[N];
long long n, a, b, T;
string s;
int f(char c) { return (c == 'w' ? b : 0); }
void pre_calculation() {
  for (int i = 1; i < n; i++) post[i] = post[i - 1] + 1 + a + f(s[i]);
  for (int i = n - 1; i > -1; i--)
    pre[n - i] = pre[n - i - 1] + 1 + a + f(s[i]);
}
int main() {
  cin >> n >> a >> b >> T >> s;
  if (T < 1 + f(s[0])) return cout << 0 << endl, 0;
  pre_calculation();
  T -= 1 + f(s[0]);
  int ans = 0;
  for (int i = 1; i < n; i++) {
    long long t = T - post[i];
    if (t < 0) break;
    t -= i * a;
    int it = upper_bound(pre, pre + n, t) - pre - 1;
    ans = max(ans, i + max(it, 0));
  }
  for (int i = 1; i < n; i++) {
    long long t = T - pre[i];
    if (t < 0) break;
    t -= i * a;
    int it = upper_bound(post, post + n, t) - post - 1;
    ans = max(ans, i + max(it, 0));
  }
  ans = min(1LL * ans + 1LL, n);
  cout << ans << endl;
}
