#include <bits/stdc++.h>
using namespace std;
int solve(int* h_orient, int a, int b, int n, int i, int j) {
  int orient = h_orient[i] + h_orient[n - 1] - h_orient[j - 1];
  orient *= b;
  int time = orient + (i - j + n) % n + 1;
  int r = i, l = n - j;
  time += (l + r + min(l, r)) * a;
  return time;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, a, b, t;
  cin >> n >> a >> b >> t;
  int* h_orient = new int[n]();
  char* orient1 = new char[n + 1];
  cin >> orient1;
  for (int i = 0; i < n; i++) {
    if (orient1[i] == 'w') {
      h_orient[i] = 1;
    }
  }
  delete orient1;
  for (int i = 1; i < n; i++) {
    h_orient[i] += h_orient[i - 1];
  }
  int num = 0;
  for (int i = 0; i < n; i++) {
    int lo = 0, hi = n - i - 1;
    while (lo < hi) {
      int mid = (lo + hi + 1) / 2;
      if (solve(h_orient, a, b, n, i, n - mid) <= t) {
        lo = mid;
      } else {
        hi = mid - 1;
      }
    }
    if (solve(h_orient, a, b, n, i, n - lo) <= t) {
      num = max(num, i + 1 + lo);
    }
  }
  cout << num;
  return 0;
}
