#include <bits/stdc++.h>
using namespace std;
char s[500010];
int v[500010], sum[500010];
int main() {
  int n, a, b, T;
  scanf("%d%d%d%d", &n, &a, &b, &T);
  scanf("%s", s + 1);
  int res = 1;
  for (int _ = 0; _ < 2; _++) {
    for (int i = 1; i <= n; i++) {
      if (s[i] == 'w') {
        v[i] = b + 1;
      } else {
        v[i] = 1;
      }
      if (i > 1) {
        v[i] += a;
      }
      sum[i] = sum[i - 1] + v[i];
    }
    int cur = v[1];
    if (cur > T) {
      puts("0");
      return 0;
    }
    int id = n;
    for (int i = n + 1; i >= 2; i--) {
      int tsum = cur;
      tsum += sum[n] - sum[i - 1];
      int have = 1 + n + 1 - i;
      int needed = T;
      if (tsum <= T) {
        res = max(res, have);
        needed -= tsum;
      } else {
        break;
      }
      needed -= a * (n + 1 - i);
      id = min(id, i - 1);
      while (id > 1 && sum[id] - sum[1] > needed) {
        id--;
      }
      res = max(res, have + id - 1);
    }
    reverse(s + 2, s + n + 1);
  }
  printf("%d\n", res);
  return 0;
}
