#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 5e5 + 20;
long long n, x, y, T, p[MAXN], sp[MAXN], p2[MAXN];
char ch[MAXN];
string s;
int main() {
  scanf("%I64d %I64d %I64d %I64d", &n, &x, &y, &T);
  scanf("%s", ch);
  s = ch;
  char cur = 'h';
  for (long long i = 0; i < n; i++) {
    if (s[i] == cur)
      p[i + 1] = p[i];
    else
      p[i + 1] = p[i] + 1, cur = s[i];
  }
  cur = s[n - 1];
  for (long long i = n - 1; i >= 0; i--) {
    if (s[i] == cur)
      sp[i] = sp[i + 1];
    else
      sp[i] = sp[i + 1] + 1;
  }
  if (n > 1) {
    cur = s[1];
    for (long long i = 1; i < n; i++)
      if (s[i] == cur)
        p2[i + 1] = p2[i];
      else
        p2[i + 1] = p2[i] + 1, cur = s[i];
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    long long ret = i * x + p[i + 1] * y + (i + 1);
    if (ret > T) continue;
    ans = max(ans, i + 1);
    long long b = i + 1, e = n - 1, rt = n;
    long long ss = y * long long(s[i] != s[n - 1]);
    while (b <= e) {
      long long mid = (b + e) / 2;
      if (ret + i * x + ss + sp[mid] * y + (n - mid) + (n - mid) * x <= T)
        rt = mid, e = mid - 1;
      else
        b = mid + 1;
    }
    ans = max(ans, i + 1 + (n - rt));
  }
  if (n > 1) {
    for (long long i = n - 1; i; i--) {
      long long ret = (n - i + 1) + (n - i) * x + sp[i] * y +
                      y * long long(s[0] != 'h') +
                      y * long long(s[0] != s[n - 1]);
      if (ret > T) continue;
      ans = max(ans, n - i + 1);
      long long b = 1, e = i - 1, rt = 0;
      while (b <= e) {
        long long mid = (b + e) / 2;
        if (ret + (n - i + mid) * x + p2[mid] * y + mid +
                y * long long(s[i] != s[mid]) <=
            T)
          rt = mid, b = mid + 1;
        else
          e = mid - 1;
      }
      ans = max(ans, n - i + 1 + rt);
    }
  }
  printf("%I64d\n", ans);
  return 0;
}
