#include <bits/stdc++.h>
using namespace std;
int n;
long long a, b, t;
string s;
long long x[1000010];
int main() {
  cin >> n >> a >> b >> t;
  cin >> s;
  for (int i = 0; i < n; i++) {
    x[i] = 1 + (s[i] == 'w') * b;
  }
  static int r[500010];
  r[1] = x[0];
  for (int k = 2; k <= n; k++) {
    r[k] = r[k - 1] + a + x[k - 1];
  }
  static int l[500010];
  l[1] = x[0];
  for (int k = 2; k <= n; k++) {
    l[k] = l[k - 1] + a + x[n + 1 - k];
  }
  int ans = 0;
  if (r[1] > t) {
    cout << ans;
    return 0;
  }
  for (int kr = 1; kr <= n; kr++) {
    if (r[kr] > t) break;
    long long tLeft = t - r[kr];
    ans = max(ans, kr);
    tLeft -= (kr - 1) * a;
    tLeft += r[1];
    if (tLeft <= 0) continue;
    int kl = upper_bound(l + 1, l + n + 1, tLeft) - l - 2;
    ans = max(ans, min(kl + kr, n));
  }
  for (int kl = 1; kl <= n; kl++) {
    if (l[kl] > t) break;
    long long tLeft = t - l[kl];
    ans = max(ans, kl);
    tLeft -= (kl - 1) * a;
    tLeft += l[1];
    if (tLeft <= 0) continue;
    int kr = upper_bound(r + 1, r + n + 1, tLeft) - r - 2;
    ans = max(ans, min(kl + kr, n));
  }
  cout << ans;
}
