#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 1000111;
const int INF = 1 << 30;
const ll LNF = 1LL << 60;
int n;
ll a, b, T, t[3 * maxn];
int main() {
  scanf("%d%I64d%I64d%I64d", &n, &a, &b, &T);
  getchar();
  for (int i = 0; i < n; i++) {
    char c = getchar();
    if (c == 'w') {
      t[maxn + i] = 1;
      t[maxn + i - n] = 1;
    } else {
      t[maxn + i] = 0;
      t[maxn + i - n] = 0;
    }
  }
  int i, j;
  i = j = maxn;
  ll Ta = 1 + ((t[j] == 1) ? b : 0);
  while (j < maxn + n - 1 && Ta + ((t[j + 1] == 1) ? b : 0) + a + 1 <= T) {
    Ta += ((t[j + 1] == 1) ? b : 0) + a + 1;
    ++j;
  }
  ll res = 0;
  if (Ta != 0) res = max(res, ll(j - i + 1));
  while (j > maxn) {
    if (i > maxn - n + 1 &&
        Ta + (j - i) * a + ((t[i - 1] == 1) ? b : 0) + a + 1 <= T) {
      Ta += (j - i) * a + ((t[i - 1] == 1) ? b : 0) + a + 1;
      --i;
      while (i > maxn - n + 1 && Ta + ((t[i - 1] == 1) ? b : 0) + a + 1 <= T) {
        Ta += ((t[i - 1] == 1) ? b : 0) + a + 1;
        --i;
      }
    }
    res = max(res, ll(j - i + 1));
    Ta -= 2 * a + 1 + ((t[j] == 1) ? b : 0);
    --j;
  }
  while (i > maxn - n + 1 && Ta + ((t[i - 1] == 1) ? b : 0) + a + 1 <= T) {
    Ta += ((t[i - 1] == 1) ? b : 0) + a + 1;
    --i;
  }
  if (Ta <= T) res = max(res, ll(j - i + 1));
  printf("%I64d\n", min((ll)n, res));
  return 0;
}
