#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int N = 2 * int(5e5) + 10;
long long int a, b, T, P[N];
int n;
string s;
int solve(string s) {
  s += s;
  int ans = 0;
  long long int prv = 0;
  P[n] = 0;
  for (int i = n - 1; i >= 0; i--)
    P[i] = P[i + 1] + a + (s[i] == 'w' ? b : 0) + 1;
  for (int i = n; i < 2 * n; i++) {
    long long int curr = prv + (i == n ? 0 : a) + (s[i] == 'w' ? b : 0) + 1;
    if (curr > T) {
      prv = curr;
      continue;
    }
    long long int left = T - curr;
    int l = i - n + 1, r = n - 1, L = n;
    long long int add = (i - n) * a;
    while (l <= r) {
      int m = (l + r) / 2;
      if (P[m] + add <= left)
        L = m, r = m - 1;
      else
        l = m + 1;
    }
    ans = max(ans, i - L + 1);
    prv = curr;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> a >> b >> T;
  cin >> s;
  int ans = solve(s);
  reverse(++s.begin(), s.end());
  ans = max(ans, solve(s));
  printf("%d\n", ans);
  return 0;
}
