#include <bits/stdc++.h>
using namespace std;
const long long oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, a, b, t;
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  s = s.substr(1) + s;
  long long res = 0;
  for (long long dir = (0); dir < (2); dir++) {
    long long m = n - 1;
    long long cost = 1 + (s[m] == 'w' ? b : 0);
    long long l = m;
    while (l > 0) {
      if (cost + a + 1 + (s[l - 1] == 'w' ? b : 0) <= t) {
        cost += a + 1 + (s[l - 1] == 'w' ? b : 0), l--;
      } else
        break;
    }
    long long r = m;
    if (cost <= t)
      res = max(res, r - l + 1);
    else
      break;
    while (r < 2 * n - 1) {
      r++;
      cost += 2 * a + 1 + (s[r] == 'w' ? b : 0);
      while (cost > t && l < m) {
        cost -= a + 1 + (s[l] == 'w' ? b : 0), l++;
      }
      if (cost <= t) res = max(res, r - l + 1);
    }
    reverse(begin(s), end(s));
  }
  cout << min(res, n) << endl;
}
