#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
char s[N];
long long arr[N];
int main() {
  long long n, a, b, t;
  cin >> n >> a >> b >> t;
  cin >> s;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    arr[i] = arr[i + n] = 1 + (s[i] == 'w' ? b : 0);
    sum += arr[i];
  }
  sum -= arr[0];
  long long l = 1, r = n, ans = 0;
  while (l <= n && r < 2 * n) {
    sum += arr[r++];
    while (r - l > n) sum -= arr[l++];
    while (sum + (r - l - 1 + min(r - 1 - n, n - l)) * a > t) sum -= arr[l++];
    ans = max(ans, r - l);
  }
  cout << ans << '\n';
}
