#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int dx2[] = {1, -1, -1, 1, 0, 0, -1, 1};
int dy2[] = {1, -1, 1, -1, 1, -1, 0, 0};
int nmx[] = {-1, -1, 1, 1, 2, -2, 2, -2};
int nmy[] = {2, -2, 2, -2, -1, -1, 1, 1};
int read() {
  int x;
  scanf("%d", &x);
  return x;
}
const int N = 5e5 + 5;
char s[N];
int n, a, b, t, ans;
long long csF[N], csB[N];
bool check(int x) {
  int j;
  long long S;
  for (int i = n + 1 - x; i <= n; i++) {
    j = (i + x - 1) % n;
    S = csF[j] + csB[i] + 1LL * min(j, n - i) * a;
    if (S <= t) return true;
  }
  return false;
}
int main() {
  scanf("%d %d %d %d", &n, &a, &b, &t);
  scanf("%s", s);
  csF[0] = (s[0] == 'w') * b + 1;
  for (int i = 1; i < n; i++) csF[i] = csF[i - 1] + a + (s[i] == 'w') * b + 1;
  csB[n] = 0;
  for (int i = n - 1; i >= 0; i--)
    csB[i] = csB[i + 1] + a + (s[i] == 'w') * b + 1;
  int l = 1;
  int r = n;
  int mid;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << ans << endl;
  return 0;
}
