#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<int, int> > > AdjList;
priority_queue<pair<int, pair<int, int> > > Edgelist;
int n, t, j, k, i, m, l, A, b;
string s;
int a[500100];
int MOD(int a, int b) { return (a % b + b) % b; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> A >> b >> t;
  cin >> s;
  for (i = 0; i < s.length(); i++) {
    if (s[i] == 'w')
      a[i] = b + 1;
    else
      a[i] = 1;
  }
  if (a[0] > t) {
    cout << 0 << endl;
  } else {
    int ANS = -1;
    int ans = 1, pi = 0, pa = 0, total = a[0];
    while (ans + 1 <= n && total + a[MOD(pa + 1, n)] + A <= t) {
      total += a[MOD(pa + 1, n)] + A;
      pa++;
      ans++;
    }
    ANS = max(ANS, ans);
    bool flag = false;
    while (pa >= 0) {
      int bckTotal = total;
      pi--;
      ans++;
      total += a[MOD(pi, n)] + (!flag ? (pa - pi) * A : A);
      flag = true;
      while (ans > n || total > t) {
        total -= a[MOD(pa, n)];
        total -= 2 * A;
        pa--;
        ans--;
      }
      if (pa >= 0)
        ANS = max(ANS, ans);
      else
        total = bckTotal, pi++, ans--;
    }
    flag = false;
    pa = 0;
    while (pi <= 0) {
      int bckTotal = total;
      pa++;
      ans++;
      total += a[MOD(pa, n)] + (!flag ? (pa - pi) * A : A);
      flag = true;
      while (ans > n || total > t) {
        total -= a[MOD(pi, n)];
        total -= 2 * A;
        pi++;
        ans--;
      }
      if (pi <= 0)
        ANS = max(ANS, ans);
      else
        total = bckTotal, pa--, ans--;
    }
    cout << ANS << endl;
  }
  return 0;
}
