#include <bits/stdc++.h>
using namespace std;
char s[10010010];
long long t;
long long n, a, b;
int ne[1001000];
int check(int x) {
  for (int i = 1; i <= x; ++i) {
    int sum = ne[i] + ne[n] - ne[n - (x - i)];
    int sum1 = min(2 * (i - 1) + x - i, 2 * (x - i) + i - 1) * a;
    if (sum + sum1 <= t) return 1;
  }
  return 0;
}
int main() {
  scanf("%d%d%d%lld", &n, &a, &b, &t);
  scanf("%s", s + 1);
  ne[0] = 0;
  for (int i = 1; i <= n; ++i) {
    ne[i] = ne[i - 1] + 1 + (s[i] == 'w' ? b : 0);
  }
  int l = 0;
  int r = n;
  int ans = 0;
  int mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  printf("%d\n", ans);
}
