#include <bits/stdc++.h>
using namespace std;
char s[1000005];
long long sum[1000005];
int n, a, b, t;
int ck(int x) {
  for (int i = 1; i <= x; i++) {
    long long tmp1 = sum[i] + (sum[n] - sum[n - (x - i)]);
    long long tmp2 = min((2 * (i - 1) + x - i) * a, a * (2 * (x - i) + i - 1));
    if (tmp1 + tmp2 <= t) return 1;
  }
  return 0;
}
int main() {
  cin >> n >> a >> b >> t;
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  for (int i = 1; i <= len; i++) {
    sum[i] = sum[i - 1] + 1 + (s[i] == 'w' ? b : 0);
  }
  int l = 0, r = n, mid;
  while (l < r) {
    mid = (l + r) >> 1;
    if (ck(mid))
      l = mid + 1;
    else
      r = mid;
  }
  if (l && !ck(l)) l--;
  cout << l << endl;
}
