#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 5e5 + 5;
long long n, a, b, t;
long long pri[maxn];
char x[maxn];
bool check(int mid) {
  long long i, j, k;
  long long sum1, sum2;
  for (i = 1; i <= mid; i++) {
    sum1 = pri[i] + (pri[n] - pri[n - (mid - i)]);
    sum2 =
        min((i - 1) * a * 2 + (mid - i) * a, (i - 1) * a + (mid - i) * a * 2);
    if (sum1 + sum2 <= t) return true;
  }
  return false;
}
void solve() {
  int i, j, k;
  cin >> n >> a >> b >> t;
  scanf("%s", x + 1);
  for (i = 1; i <= n; i++) {
    pri[i] = pri[i - 1] + 1 + (x[i] == 'w' ? b : 0);
  }
  int le = 0, ri = n, mid;
  while (le < ri) {
    mid = (le + ri + 1) / 2;
    if (check(mid)) {
      le = mid;
    } else
      ri = mid - 1;
  }
  printf("%d", le);
}
int main() {
  solve();
  return 0;
}
