#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class A, size_t N, class T>
void Fill(A (&a)[N], const T &v) {
  fill((T *)a, (T *)(a + N), v);
}
const int INF = 0x3fffffff;
int n, a, b, T, ans = 0;
void solve(string S) {
  long long int sum[500005] = {}, sum_r[500005] = {};
  for (int i = 0; i < (S.length()); i++) {
    sum[i + 1] = sum[i] + 1 + (i > 0 ? a : 0) + (S[i] == 'w' ? b : 0);
    if (sum[i + 1] <= T) chmax(ans, i + 1);
  }
  for (int i = (S.length()) - 1; i >= 0; i--) {
    sum_r[i] = sum_r[i + 1] + 1 + a + (S[i] == 'w' ? b : 0);
  }
  for (int i = 0; i < (n); i++) {
    long long int cost = sum[i + 1] + (long long int)i * a;
    if (cost > T) break;
    cost = T - cost;
    int l = i, r = n;
    while (r - l > 1) {
      int c = (r + l + 1) / 2;
      if (sum_r[c] <= cost) {
        r = c;
      } else {
        l = c;
      }
    }
    chmax(ans, n - r + i + 1);
  }
}
int main() {
  string S;
  cin >> n >> a >> b >> T;
  cin >> S;
  solve(S);
  string Sr = S.substr(1) + S.at(0);
  reverse((Sr).begin(), (Sr).end());
  solve(Sr);
  printf("%d\n", ans);
  return 0;
}
