#include <bits/stdc++.h>
using namespace std;
const int N = (int)5e5 + 10;
int n, a, b, t;
int ori[N], acc[N];
bool ok(int left, int right) {
  if (left != 1 && right < n + 1) return false;
  int cnt1 = acc[right] - acc[left - 1];
  int cnt0 = (right - left + 1) - cnt1;
  int all_time = 0;
  all_time += cnt1 * b;
  all_time += (right - left + 1);
  int pos = (left == 1 ? 1 : n + 1);
  int dist_to_left = pos - left;
  int dist_to_right = right - pos;
  all_time += 2 * min(dist_to_right, dist_to_left) * a +
              max(dist_to_right, dist_to_left) * a;
  return (all_time <= t);
}
int main() {
  scanf("%d %d %d %d\n", &n, &a, &b, &t);
  for (int i = 1; i <= n; i++) {
    char x = getchar();
    ori[i] = ori[i + n] = (x == 'w' ? 1 : 0);
  }
  for (int i = 1; i <= 2 * n; i++) acc[i] = acc[i - 1] + ori[i];
  int res = 0;
  for (int i = 1; i <= n; i++) {
    for (int left = 1, right = n, mid; left <= right;) {
      mid = (left + right) >> 1;
      if (ok(i, i + mid - 1)) {
        res = max(res, mid);
        left = mid + 1;
      } else {
        right = mid - 1;
      }
    }
  }
  printf("%d", res);
  return 0;
}
