#include <bits/stdc++.h>
using namespace std;
const int N = 500000 + 5;
int n, a, b, ti;
char s[N << 1];
long long cost[N << 1];
int bin(int l, int r, int x) {
  int ret = -1;
  while (l <= r) {
    int mid = l + r >> 1;
    if (cost[mid] <= x) {
      ret = mid;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  return ret;
}
int solve() {
  for (int i = n; i < n << 1; i++) s[i] = s[i - n];
  for (int i = 0; i < n << 1; i++) {
    if (s[i] == 'w')
      cost[i] = b + 1;
    else
      cost[i] = 1;
  }
  if (cost[n] > ti) return 0;
  ti -= cost[n];
  int ans = 1;
  for (int i = n + 1; i < n << 1; i++) {
    cost[i] = cost[i - 1] + cost[i] + a;
  }
  for (int i = n - 1; i >= 0; i--) cost[i] = cost[i + 1] + cost[i] + a;
  for (int i = 0; i < n << 1; i++)
    if (i != n) cost[i] -= cost[n];
  for (int i = 1; i < n; i++)
    if (cost[i] <= ti) {
      int cur = n - i + 1;
      ans = max(ans, cur);
      int res = ti - cost[i];
      if (1ll * (n - i) * a <= res) {
        res -= a * (n - i);
        int fd = bin(n + 1, n * 2 - 1, res);
        if (fd != -1) ans = max(ans, cur + fd - n);
      }
    }
  reverse(cost, cost + 2 * n);
  for (int i = 0; i < n - 1; i++)
    if (cost[i] <= ti) {
      int cur = n - 1 - i + 1;
      ans = max(ans, cur);
      int res = ti - cost[i];
      if (1ll * (n - 1 - i) * a <= res) {
        res -= a * (n - 1 - i);
        int fd = bin(n, n * 2 - 1, res);
        if (fd != -1) ans = max(ans, cur + fd - (n - 1));
      }
    }
  return min(ans, n);
}
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &ti);
  scanf("%s", s);
  printf("%d\n", solve());
  return 0;
}
