#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 2000;
string pos;
long long cnt[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, a, b, T;
  cin >> n >> a >> b >> T;
  cin >> pos;
  pos += pos;
  int ans = 0;
  int be;
  for (int it = 0; it < 2; it++) {
    if (it == 0) {
      be = n;
    } else {
      reverse(pos.begin(), pos.end());
      be = n - 1;
    }
    memset(cnt, 0, sizeof cnt);
    cnt[be] = (pos[be] == 'w' ? b : 0) + 1;
    for (int i = be + 1; i < 2 * n; i++) {
      cnt[i] = cnt[i - 1] + 1 + a + (pos[i] == 'w' ? b : 0);
    }
    cnt[be - 1] = (pos[be - 1] == 'w' ? b : 0) + 1;
    for (int i = be - 2; i >= 0; i--) {
      cnt[i] = cnt[i + 1] + 1 + a + (pos[i] == 'w' ? b : 0);
    }
    int r = 1;
    for (int l = be; l < 2 * n; l++) {
      while (r < be && cnt[l] + cnt[r] + a * (l - be + 1) > T) {
        r++;
      }
      if (r < be) {
        ans = max(ans, l - r + 1);
      }
      if (cnt[l] <= T) {
        ans = max(ans, l - be + 1);
      }
    }
  }
  cout << min(n, ans) << endl;
  return 0;
}
