#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int N, A, B, T;
string s, rs, ss;
int solve(string s) {
  s += s;
  vector<int> sum(s.size() + 1);
  for (int i = 0; i < (int)(s.size()); ++i)
    sum[i + 1] = sum[i] + (s[i] == 'w') * B;
  int res = 0;
  for (int l = 0; l < (int)(N); ++l) {
    int t = T;
    t -= sum[N + 1] - sum[l + 1] + 2 * (N - l - 1) * A + (N - l);
    if (t < 0) continue;
    int lb = N, ub = l + N + 1;
    while (ub - lb > 1) {
      int mid = (lb + ub) / 2;
      if ((mid - N) * A + sum[mid + 1] - sum[N + 1] + mid - N <= t)
        lb = mid;
      else
        ub = mid;
    }
    res = max(res, lb - l);
  }
  return res;
}
int main(void) {
  cin >> N >> A >> B >> T >> s;
  s = s + s + s[0];
  ss = s;
  reverse(ss.begin(), ss.end());
  cout << max(solve(s), solve(ss)) << endl;
  return 0;
}
