#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long linf = 1e18 + 7;
const int inf = 1e9 + 7;
const int N = 1e6 + 5;
long long n, a, b, T, pref[N];
string s;
bool check(int x) {
  long long mn = linf;
  int pos = x;
  while (pos >= 1) {
    int l = pos - x + 1, r = pos;
    if (l <= 0) l = n + l;
    long long res = x;
    res += (x - 1) * a;
    if (l <= r) {
      res += pref[r] - pref[l - 1];
    } else {
      res += pref[r];
      res += pref[n] - pref[l - 1];
      res += min((int(n) - l + 1), (r - 1)) * a;
    }
    mn = min(res, mn);
    pos--;
  }
  return mn <= T;
}
int main() {
  cin >> n >> a >> b >> T >> s;
  s = ' ' + s;
  for (int i = 1; i <= n; i++) {
    if (s[i] == 'w') pref[i] += b;
    pref[i] += pref[i - 1];
  }
  int l = 0, r = n;
  while (r - l > 1) {
    int md = (l + r) >> 1;
    if (check(md))
      l = md;
    else
      r = md;
  }
  if (check(r)) l = r;
  cout << l << endl;
}
