#include <bits/stdc++.h>
using namespace std;
long long fastpow(long long x, long long y) {
  if (!y) return 1;
  if (y % 2) return (x * fastpow(x, y - 1));
  return fastpow((x * x), y / 2);
}
long long bs(long long s, long long e, long long targ, vector<long long> &v) {
  long long mid, ans = 0;
  while (s <= e) {
    mid = (s + e) / 2;
    if (v[mid] <= targ) {
      ans = mid;
      s = mid + 1;
    } else
      e = mid - 1;
  }
  return ans;
}
int main() {
  vector<long long> v, v2;
  long long n, a, b, t, c[50005], r1[50005] = {}, r2[50005] = {};
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    c[i] = ((s[i] == 'w') * b) + 1;
  }
  r1[0] = ((s[0] == 'w') * b) + 1;
  for (int i = 1; i < n; i++) {
    r1[i] = r1[i - 1] + c[i] + a;
  }
  r2[n - 1] = ((s[n - 1] == 'w') * b) + 1;
  for (int i = n - 2; i >= 0; i--) {
    r2[i] = r2[i + 1] + c[i] + a;
  }
  for (int i = 0; i < n; i++) v.push_back(r2[i]);
  sort(v.begin(), v.end());
  for (int i = 0; i < n; i++) v2.push_back(r1[i]);
  sort(v.begin(), v.end());
  long long mx = 0, cnt = r1[0];
  for (int i = 0; i < n; i++) {
    int cnt = r1[i];
    if (cnt <= t) {
      if ((cnt + ((i + 1) * a)) <= t) {
        if (v[0] > (t - (cnt + ((i + 1) * a))) + 1) break;
        long long ans = bs(0, v.size() - 1, (t - (cnt + ((i + 1) * a))) + 1, v);
        if (ans + i + 2 <= n)
          mx = max(mx, ans + i + 2);
        else
          return cout << n, 0;
      } else
        mx = max(mx, (long long)i + 1);
    }
  }
  sort(r2, r2 + n);
  long long mx2 = 0, cnt2 = r1[0];
  for (int i = 1; i < n; i++) {
    cnt2 = r2[i];
    if (cnt2 <= t) {
      if ((cnt2 + ((i)*a)) <= t) {
        if (v2[0] > (t - (cnt2 + ((i)*a))) + (r1[0] - 1)) break;
        long long ans =
            bs(0, v2.size() - 1, (t - (cnt2 + ((i)*a))) + (r1[0] - 1), v2);
        if (ans + i + 1 <= n)
          mx2 = max(mx2, ans + i + 1);
        else
          return cout << n, 0;
      } else
        mx2 = max(mx2, (long long)i);
    }
  }
  cout << max(mx, mx2) << endl;
}
