#include <bits/stdc++.h>
using namespace std;
const int MX = 100000 * 10 + 10;
int n, a, b, t, ans;
char c;
int ti[MX], sum;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n >> a >> b >> t;
  for (int i = 0; i < n; i++) {
    cin >> c;
    sum += ti[i] = ti[i + n] = ((c == 'w') ? 1 : 0) * b + 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(r - l, ans);
  }
  cout << ans << endl;
  return 0;
}
