#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 j = n;
  while (solve(h_orient, a, b, n, 0, j) <= t && j > 0) {
    j--;
  }
  if (j == 0 || j == n) {
    cout << (n - j);
    return 0;
  }
  int num = (n - j) % n;
  for (int i = 0; j <= n;) {
    if (solve(h_orient, a, b, n, i + 1, j) <= t) {
      i++;
      num = max(num, (i - j + n) % n + 1);
    } else {
      j++;
    }
  }
  cout << num;
  return 0;
}
