#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
bool A[N];
long long prefix[N], suffix[N];
int main() {
  int n, a, b, T, ans = 0;
  string s;
  cin >> n >> a >> b >> T;
  cin >> s;
  for (int i = 0; i < n; i++) A[i + 1] = (s[i] == 'w' ? 1 : 0);
  for (int big = 1; big <= 2; big++) {
    int start = 1;
    for (int i = n; i >= 1; i--) suffix[i] = (A[i] * b) + a + 1 + suffix[i + 1];
    prefix[1] = (A[1] * b) + 1;
    for (int i = 2; i <= n; i++) prefix[i] = (A[i] * b) + a + 1 + prefix[i - 1];
    for (int i = 1; i <= n; i++) {
      if (prefix[i] <= T) ans = max(ans, i);
      int tmp = T - prefix[i] - (i - 1) * a;
      if (tmp < 0) break;
      while (start) {
        if (start == n + 1) break;
        if (suffix[start] < tmp) {
          if (start == i) {
            cout << n << endl;
            return 0;
          } else
            break;
        }
        start++;
      }
      ans = max(ans, i + n - start + 1);
    }
    reverse(A + 2, A + n + 1);
  }
  cout << ans;
}
