#include <bits/stdc++.h>
using namespace std;
const long long infl = 1e18 + 5;
long long int n, m, k, q, x, y, f, val, t = 1, i, j;
long long int ind = -1, cnt, sz, sm, ans, mx = -1, mn = infl;
long long int a, b, tot, pre[1000004], rpre[1000004];
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("inp.txt", "r")) {
    freopen("myfile.txt", "w", stdout);
    freopen("inp.txt", "r", stdin);
  }
  cin >> n >> a >> b >> tot;
  cin >> s;
  t = 0;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'w') t += b;
    t++;
    pre[i + 1] = t;
    t += a;
  }
  reverse(s.begin(), s.end());
  t = 0;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == 'w') t += b;
    t++;
    rpre[i + 1] = t;
    t += a;
  }
  ans = 0;
  m = s.size();
  for (i = 1; i < m + 1; i++) {
    long long int rem = tot - pre[i] - (a * i);
    if (rem < 0) break;
    long long int low = 0, high = m, mid, bans = 0;
    while (low <= high) {
      mid = (low + high) / 2;
      if (rpre[mid] <= rem) {
        bans = mid;
        low = mid + 1;
      } else {
        high = mid - 1;
      }
    }
    ans = max(ans, i + bans);
  }
  for (i = 1; i < m + 1; i++) {
    long long int rem = tot - rpre[i] - (a * i) - a;
    long long int low = 2, high = m, mid, bans = 0;
    while (low <= high) {
      mid = (low + high) / 2;
      if (pre[mid] <= rem) {
        bans = mid;
        low = mid + 1;
      } else {
        high = mid - 1;
      }
    }
    ans = max(ans, i + bans + 1);
  }
  cout << min(m, ans);
  return 0;
}
