#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5;
int forth[MAXN + 5], backward[MAXN + 5];
int n, a, b, T;
char str[MAXN + 5];
bool check(int left, int right) {
  long long ret = 0;
  ret += (right - 1LL) * a;
  ret += 1LL * left * a;
  ret += left + right;
  ret += 1LL * forth[right - 1] * b;
  if (left > 0) ret += 1LL * backward[n - left] * b;
  ret += 1LL * min(left, right - 1) * a;
  return ret <= T;
}
int main() {
  int c, c2;
  scanf("%d%d%d%d%s", &n, &a, &b, &T, str);
  forth[0] = str[0] == 'w';
  for (int i = 1; i < n; i++) forth[i] = forth[i - 1] + (str[i] == 'w');
  backward[n - 1] = str[n - 1] == 'w';
  for (int i = n - 2; i >= 0; i--)
    backward[i] = backward[i + 1] + (str[i] == 'w');
  if (1LL * forth[n - 1] * b + (a - 1LL) * n + n <= T)
    printf("%d\n", n);
  else {
    int ret = 0;
    for (int right = 1; right < n; right++) {
      int s = 0, e = n - 1;
      while (s <= e) {
        int left = s + e >> 1;
        if (check(left, right)) {
          ret = max(ret, left + right);
          s = left + 1;
        } else {
          e = left - 1;
        }
      }
    }
    printf("%d\n", ret);
  }
  return 0;
}
