#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
int a[N], sum[N], t[N];
int n, A, B, T, ans;
char s[N];
int erfen(int l, int r, int s) {
  if (l > r) return 0;
  if (s < sum[r]) return 0;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (sum[mid] > s)
      l = mid + 1;
    else
      r = mid;
  }
  return n - r + 1;
}
int er(int l, int r, int s) {
  if (l + 1 > r) return 0;
  if (s < sum[l]) return 0;
  while (l + 1 < r) {
    int mid = (l + r) >> 1;
    if (sum[mid] < s)
      l = mid;
    else
      r = mid;
  }
  return l - n - 1;
}
int main() {
  scanf("%d%d%d%d", &n, &A, &B, &T);
  scanf("%s", s);
  for (int i = 0; i < n; i++)
    if (s[i] == 'w') a[i + 1] = 1;
  for (int i = 1; i <= n; i++) a[i + n] = a[i];
  for (int i = n; i >= 1; i--) sum[i] = sum[i + 1] + A + B * a[i] + 1;
  if (T < B * a[n + 1] + 1) {
    printf("0\n");
    return 0;
  }
  sum[n + 1] = B * a[n + 1] + 1;
  ans = max(ans, erfen(2, n, T - sum[n + 1]) + 1);
  for (int i = n + 2; i <= n * 2; i++) {
    sum[i] = sum[i - 1] + A + B * a[i] + 1;
    if (sum[i] > T) break;
    t[i] = t[i - 1] + A;
    ans = max(ans, erfen(i - n + 1, n, T - sum[i] - t[i]) + i - n);
  }
  memset(sum, 0, sizeof(sum));
  for (int i = n + 2; i <= n * 2; i++) sum[i] = sum[i - 1] + A + B * a[i] + 1;
  sum[n + 1] = B * a[n + 1] + 1;
  for (int i = n; i > 1; i--) {
    sum[i] = sum[i + 1] + A + B * a[i] + 1;
    if (sum[i] > T) break;
    t[i] = t[i + 1] + A;
    ans = max(ans, er(n + 2, n + i, T - sum[i] - t[i]) + n + 2 - i);
  }
  printf("%d\n", ans);
  return 0;
}
