#include <bits/stdc++.h>
using namespace std;
char s[500010];
long long S[500010], T[500010];
int n, Tt, A, B;
template <class T>
void read(T &x) {
  char ch = getchar();
  int mk = 1;
  x = 0;
  for (; ch != '-' && (ch < '0' || ch > '9'); ch = getchar())
    ;
  if (ch == '-') mk = -1, ch = getchar();
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - 48;
  x *= mk;
}
int Get(char *s) {
  s[0] = 'h';
  for (int i = 1; i <= n; i++)
    S[i] = S[i - 1] + (s[i] != s[i - 1]) * B + (i > 1) * A + 1;
  T[1] = 1;
  for (int i = n - 1; i > 1; i--)
    T[n - i + 1] = T[n - i] + (s[i] != s[i + 1]) * B + A + 1;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (Tt < S[i]) break;
    ans = max(ans, i);
    if (Tt - S[i] - B * (s[n] != s[i]) - A * i < 0) continue;
    int t = upper_bound(T, T + (n - i) + 1,
                        Tt - S[i] - B * (s[n] != s[i]) - A * i) -
            T - 1;
    ans = max(ans, i + t);
  }
  return ans;
}
int main() {
  read(n);
  read(A);
  read(B);
  read(Tt);
  scanf("%s", s + 1);
  char t[500010];
  t[1] = s[1];
  for (int i = n; i > 1; i--) t[n - i + 2] = s[i];
  printf("%d\n", max(Get(s), Get(t)));
  return 0;
}
