#include <bits/stdc++.h>
using namespace std;
int N, A, B, T;
string S;
bool check(int num) {
  int cntw = 0;
  for (int i = N - num + 1; i <= N; i++) cntw += S[i] == 'w';
  if ((long long)cntw * B + num + (long long)(num - 1) * A <= T) return true;
  for (int i = N - num + 2; i <= N; i++) {
    cntw -= S[i - 1] == 'w';
    cntw += S[i + num - 1] == 'w';
    if ((long long)cntw * B + num +
            (long long)(num - 1 + min(i + num - 1 - N, N - i)) * A <=
        T)
      return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> N >> A >> B >> T >> S;
  S += S;
  int lo = 0, hi = N;
  while (lo < hi) {
    int mid = lo + (hi - lo + 1) / 2;
    if (check(mid))
      lo = mid;
    else
      hi = mid - 1;
  }
  cout << lo << "\n";
  return 0;
}
