#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int n, a, b, t;
string p;
int l[500100];
int r[500100];
vector<int> ll, rr;
int ans = 0;
int node = 0;
int main() {
  scanf("%d%d%d%d", &n, &a, &b, &t);
  cin >> p;
  node = b * (p[0] == 'w') + 1;
  l[0] = node;
  for (int i = 1; i < n; i++) l[i] = l[i - 1] + b * (p[i] == 'w') + a + 1;
  r[0] = node;
  r[n - 1] = a + b * (p[n - 1] == 'w') + r[0] + 1;
  for (int i = n - 2; i > 0; i--) r[i] = r[i + 1] + b * (p[i] == 'w') + a + 1;
  for (int i = 0; i < n; i++) ll.push_back(l[i]);
  rr.push_back(r[0]);
  for (int i = n - 1; i > 0; i--) rr.push_back(r[i]);
  int k = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (ll[i] <= t) ans = max(ans, i + 1);
    if (ll[i] + a * i > t) continue;
    while (k < n && rr[k] + ll[i] + a * i - node <= t) k++;
    ans = max(ans, i + k);
  }
  k = 0;
  for (int i = n - 1; i > 0; i--) {
    if (rr[i] <= t) ans = max(ans, i + 1);
    if (rr[i] + a * i > t) continue;
    while (k < n && ll[k] + rr[i] + a * i - node <= t) k++;
    ans = max(ans, i + k);
  }
  printf("%d", min(ans, n));
  return 0;
}
