#include <bits/stdc++.h>
using namespace std;
const int N = 500010;
int n, a, b, T;
string s;
int sum[N];
int ret;
void go() {
  int pt = 1;
  for (int i = 1; i <= n; i++) {
    int cost1 = b * sum[i] + a * (i - 1) + i;
    if (cost1 > T) {
      return;
    }
    if (i > ret) ret = i;
    int cost2 = (i - 1) * a;
    if (cost1 + cost2 > T) {
      continue;
    }
    int left = T - cost1 - cost2;
    while (pt <= n && b * (sum[n] - sum[pt]) + a * (n - pt) + n - pt > left) {
      pt++;
    }
    int tmp = i + n - pt;
    if (tmp > n) tmp = n;
    if (tmp > ret) ret = tmp;
  }
}
int main() {
  cin >> n >> a >> b >> T;
  cin >> s;
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + (s[i - 1] == 'w');
  }
  go();
  sum[1] = (s[0] == 'w');
  for (int i = 2; i <= n; i++) {
    sum[i] = sum[i - 1] + (s[n - i + 1] == 'w');
  }
  go();
  cout << ret;
  return 0;
}
