#include <bits/stdc++.h>
using namespace std;
long long a[550000], r[550000], l[550000], INF = 1000000000;
char d;
int main() {
  long long n, c, b, t, ans = 0;
  cin >> n >> c >> b >> t;
  for (int i = 0; i < n; i++) {
    cin >> d;
    if (d == 'w') a[i] = b;
  }
  l[0] = a[0] + 1;
  for (int i = 1; i < n; i++) {
    l[i] = min(INF, l[i - 1] + c + a[i] + 1);
    r[i] = min(INF, r[i - 1] + c + a[n - i] + 1);
  }
  long long pans, j = 0;
  for (int i = 0; i < n; i++) {
    if (l[i] + c * i <= t) j = i;
    pans = j + (upper_bound(r, r + n, t - c * i - l[i]) - r);
    ans = max(ans, min(n, pans));
  }
  cout << ans;
}
