#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, t, ans = 0;
  cin >> n >> a >> b >> t;
  vector<int> ti(2 * n);
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    char k;
    cin >> k;
    sum += ti[i] = ti[n + i] = k == 'w' ? b + 1 : 1;
  }
  sum -= ti[0];
  int l = 1, r = n;
  while (l <= n && r < 2 * n) {
    sum += ti[r++];
    while (r - l > n || sum + (r - l - 1 + min(n - l, r - n - 1)) * a > t)
      sum -= ti[l++];
    if (l > n) break;
    ans = max(ans, r - l);
  }
  cout << ans << endl;
}
