#include <bits/stdc++.h>
using namespace std;
string s;
long long aa[500010];
int main() {
  ios_base::sync_with_stdio(0);
  long long n, a, b;
  long long t;
  cin >> n >> a >> b >> t;
  cin >> s;
  for (int i = s.length() - 1; i >= 0; i--) {
    aa[i] = aa[i + 1] + 1 + a;
    if (s[i] == 'w') aa[i] += b;
  }
  long long ans = 0;
  long long id = 0;
  long long tm = 0;
  long long tc = 0;
  for (int i = 0; i < n; i++) {
    tm++;
    if (s[i] == 'w') tm += b;
    if (tm + tc > t) break;
    while (id <= n && tm + tc + aa[id] > t) id++;
    tc += a;
    ans = max(ans, i + 1 + (n - id));
  }
  cout << min(ans, n) << endl;
  return 0;
}
