#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-9;
char s[500005];
int A[500005];
int B[500005];
int main() {
  int n, i, j, m, a, b, t;
  scanf("%d%d%d%d", &n, &a, &b, &t);
  int ans, ans2, t2 = t, T = t;
  ans = ans2 = 0;
  scanf("%s", s);
  for (i = 0; i < n; i++) {
    if (t > 0) {
      if (s[i] == 'w') t -= b;
      t--;
    }
    if (t2 > 0) {
      if (s[(n - i) % n] == 'w') t2 -= b;
      t2--;
    }
    A[i] = t;
    B[(n - i) % n] = t2;
    t -= a;
    t2 -= a;
  }
  if (s[0] == 'w')
    t2 = b + 1;
  else
    t2 = 1;
  j = 1;
  for (i = 0; i < n; i++) {
    if (A[i] > 0) {
      while (j <= i || A[i] - i * (long long)a + t2 - (T - B[j]) < 0 && j < n)
        j++;
      if (A[i] - i * (long long)a + t2 - (T - B[j]) >= 0) {
        ans = max(ans, n + i - j + 1);
      }
    }
  }
  j = n - 1;
  for (i = 0; i < n; i++) {
    if (B[(n - i) % n] > 0) {
      while (j >= (n - i) % n ||
             B[(n - i) % n] - i * (long long)a + t2 - (T - A[j]) < 0 && j >= 0)
        j--;
      if (B[(n - i) % n] - i * (long long)a + t2 - (T - A[j]) >= 0) {
        ans = max(ans, i + j + 1);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
