#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
int t[maxn * 2];
int main() {
  long long a, b, T, sum = 0;
  int n, ans = 0;
  cin >> n >> a >> b >> T;
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    sum += (t[i] = t[i + n] = (c == 'w' ? b + 1 : 1));
  }
  sum -= t[0];
  int l = 1, r = n;
  while (l <= n && r < 2 * n) {
    sum += t[r++];
    while (r - l > n || (sum + (r - l - 1 + min(n - l, r - n - 1)) * a) > T)
      sum -= t[l++];
    if (l > n) break;
    ans = max(ans, r - l);
  }
  printf("%d\n", ans);
  return 0;
}
