#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, b, t;
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  vector<long long> pref(n), suff(n);
  pref[0] = (s[0] == 'w') * b + 1;
  suff[n - 1] = (s[n - 1] == 'w') * b + 1 + a;
  for (long long i = 1; i < n; i++)
    pref[i] = pref[i - 1] + a + (s[i] == 'w') * b + 1;
  for (long long i = n - 2; i >= 0; i--)
    suff[i] = suff[i + 1] + a + (s[i] == 'w') * b + 1;
  reverse(suff.begin(), suff.end());
  long long res = 0;
  for (long long i = 0; i < n; i++) {
    long long custo = pref[i] + a * i;
    long long resto = t - custo;
    if (resto < 0) break;
    res = max(res, i + 1);
    long long pos = upper_bound(suff.begin(), suff.end(), resto) - suff.begin();
    pos = min(pos, n - i - 1);
    res = max(res, i + 1 + pos);
  }
  cout << res << endl;
  return 0;
}
