#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) { return a > b; }
int main(int argc, char const *argv[]) {
  long long n, a, b, t;
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  long long pre[n + 1];
  pre[n] = 0;
  for (long long i = n - 1; i >= 0; i--) {
    pre[i] = 1 + pre[i + 1];
    if (s[i] == 'w') {
      pre[i] += b;
    }
    if (i != n - 1) {
      pre[i] += a;
    }
  }
  long long mx = 0;
  for (long long i = 0; i < n; i++) {
    long long tem = pre[0] - pre[i + 1];
    tem += (i * a);
    if (tem > t) {
      continue;
    }
    long long x = lower_bound(pre, pre + n, t - tem, comp) - pre;
    long long cnt = i + 1 + n - x;
    mx = max(mx, cnt);
    mx = min(mx, n);
  }
  pre[0] = 0;
  for (int i = 1; i <= n; i++) {
    pre[i] = 1 + pre[i - 1];
    if (s[i - 1] == 'w') pre[i] += b;
    if (i != 1) {
      pre[i] += a;
    }
  }
  for (int i = n; i > 0; i--) {
    long long tem = pre[n] - pre[i - 1];
    tem += (n - i + 1) * a;
    if (tem > t) continue;
    long long x = upper_bound(pre + 1, pre + n + 1, t - tem) - pre;
    if (x) x--;
    long long cnt = x + n - i + 1;
    mx = max(mx, cnt);
    mx = min(mx, n);
  }
  printf("%lld\n", mx);
  return 0;
}
