#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, T;
  cin >> n >> a >> b >> T;
  string ori;
  cin >> ori;
  int res = 0;
  int left = 0, right = 0;
  long long cost = 0;
  if (ori[0] == 'w') cost += b;
  cost += 1;
  if (cost > T) {
    cout << "0" << endl;
    return 0;
  } else {
    res++;
  }
  while (true) {
    left = (left - 1 + n) % n;
    long long add = 0;
    add += a;
    if (ori[left] == 'w') add += b;
    add += 1;
    if (add + cost > T) break;
    cost += add;
    res++;
    if (left == 0) {
      cout << n << endl;
      return 0;
    }
  }
  cost += (res - 1) * a;
  while (right < n - 1) {
    bool stop = false;
    right++;
    cost += a;
    if (ori[right] == 'w') cost += b;
    cost += 1;
    while (cost > T) {
      left = (left + 1) % n;
      cost -= 2 * a;
      if (ori[left] == 'w') cost -= b;
      cost -= 1;
      if (left == 0) {
        stop = true;
        break;
      }
    }
    if (stop) break;
    res = max(res, (n - left - 1) % n + right + 1);
  }
  string nori;
  nori += ori[0];
  for (int i = 1; i < n; i++) nori += ori[n - i];
  int nres = 0;
  left = 0, right = 0;
  cost = 0;
  if (nori[0] == 'w') cost += b;
  cost += 1;
  if (cost > T) {
    cout << "0" << endl;
    return 0;
  } else {
    nres++;
  }
  while (true) {
    left = (left - 1 + n) % n;
    long long add = 0;
    add += a;
    if (nori[left] == 'w') add += b;
    add += 1;
    if (add + cost > T) break;
    cost += add;
    nres++;
    if (left == 0) {
      cout << n << endl;
      return 0;
    }
  }
  cost += (nres - 1) * a;
  while (right < n - 1) {
    bool stop = false;
    right++;
    cost += a;
    if (nori[right] == 'w') cost += b;
    cost += 1;
    while (cost > T) {
      left = (left + 1) % n;
      cost -= 2 * a;
      if (nori[left] == 'w') cost -= b;
      cost -= 1;
      if (left == 0) {
        stop = true;
        break;
      }
    }
    if (stop) break;
    nres = max(nres, (n - left - 1) % n + right + 1);
  }
  cout << max(res, nres) << endl;
}
