#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 50;
string s;
int cost[N * 2];
long long pref[N * 2];
long long suff[N * 2];
int main() {
  int n, a, b, T;
  cin >> n >> a >> b >> T;
  cin >> s;
  for (int i = 0; i < n; i++)
    if (s[i] == 'w')
      cost[i] = cost[i + n] = 1 + b;
    else
      cost[i] = cost[i + n] = 1;
  for (int i = n + 1; i < 2 * n; i++) pref[i] = cost[i] + a + pref[i - 1];
  for (int i = n - 1; i >= 1; i--) suff[i] = cost[i] + a + suff[i + 1];
  int ans = 0;
  for (int i = n; i >= 1; i--) {
    long long Time = T - cost[n] - suff[i];
    int cnt = n - i + 1;
    if (Time < 0) break;
    int lo = n, hi = n + i - 1;
    int ex = 0;
    while (lo <= hi) {
      int mid = lo + hi >> 1;
      if (pref[mid] + (n - i) * a <= Time)
        ex = mid - n, lo = mid + 1;
      else
        hi = mid - 1;
    }
    cnt += ex;
    ans = max(ans, cnt);
  }
  for (int i = n; i < 2 * n; i++) {
    long long Time = T - cost[n] - pref[i];
    int cnt = i - n + 1;
    if (Time < 0) break;
    int lo = n, hi = i - n + 1;
    int ex = 0;
    while (hi <= lo) {
      int mid = lo + hi >> 1;
      if (suff[mid] + (i - n) * a <= Time)
        ex = n - mid, lo = mid - 1;
      else
        hi = mid + 1;
    }
    cnt += ex;
    ans = max(ans, cnt);
  }
  cout << ans << endl;
  return 0;
}
