#include <bits/stdc++.h>
using namespace std;
const int maxn = 500005;
using ll = long long;
ll state[maxn + maxn];
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, a, b, T;
  cin >> n >> a >> b >> T;
  for (int i = 1; i <= n; ++i) {
    char c;
    cin >> c;
    if (c == 'w')
      state[i] = 0;
    else
      state[i] = 1;
    state[i + n] = state[i];
  }
  vector<ll> r(n + n + 1);
  ll sum = 0;
  int ans = 0;
  for (int i = n + 1; i <= n + n; ++i) {
    ll cur = (state[i] == 0 ? b : 0) + (i != n + 1 ? a : 0) + 1;
    sum += cur;
    r[i] = sum;
    if (r[i] <= T) {
      ans = max(ans, i - n);
    }
  }
  vector<ll> l(n + n + 1);
  sum = 0;
  for (int i = n + 1; i >= 1; --i) {
    ll cur = (state[i] == 0 ? b : 0) + (i != n ? a : 0) + 1;
    sum += cur;
    l[i] = sum;
    if (l[i] <= T) {
      ans = max(ans, n - i + 2);
    }
  }
  for (int i = n + 1; i <= n + n; ++i) {
    ll rem = T - r[i] - ((i - n - 1) * a);
    if (rem <= 0) break;
    int lo = 1, hi = n, res = 0;
    while (lo <= hi) {
      int mid = (lo + hi) >> 1;
      ll cost = l[mid] - l[n + 1];
      if (cost <= rem) {
        res = mid;
        hi = mid - 1;
      } else {
        lo = mid + 1;
      }
    }
    ans = max(ans, (i - n) + (n - res + 1));
  }
  for (int i = n; i >= 1; --i) {
    ll rem = T - l[i] - ((n + 1 - i) * a);
    if (rem <= 0) break;
    int lo = n + 1, hi = n + n, res = 0;
    while (lo <= hi) {
      int mid = (lo + hi) >> 1;
      ll cost = r[mid] - r[n + 1];
      if (cost <= rem) {
        res = mid;
        lo = mid + 1;
      } else {
        hi = mid - 1;
      }
    }
    ans = max(ans, n - i + res - n - 1);
  }
  cout << min(ans, n) << endl;
  return 0;
}
