#include <bits/stdc++.h>
using namespace std;
long long int n, a, b, t, res, cnt[1000100], l, r;
int main() {
  string s;
  cin >> n >> a >> b >> t >> s;
  for (int i = 1; i <= n; i++) {
    (s[i - 1] == 'w') ? cnt[i] = cnt[i + n] = b + 1 : cnt[i] = cnt[i + n] = 1;
  }
  long long int temp = a + cnt[n + 1];
  for (int i = n; i > 1; i--) {
    cnt[i] += temp;
    temp = a + cnt[i];
  }
  temp = a;
  for (int i = n + 2; i <= 2 * n; i++) {
    cnt[i] += temp;
    temp = a + cnt[i];
  }
  res = 0;
  r = n + 1;
  l = n + 2;
  for (int i = 2; i <= n + 1; i++) {
    if (cnt[i] <= t) {
      res = n + 2 - i;
      l = i;
      break;
    }
  }
  if (l == n + 2) {
    cout << "0\n";
    return 0;
  }
  for (int j = l; j <= n + 1; j++) {
    for (int k = r + 1; k <= 2 * n; k++) {
      if (cnt[j] + cnt[k] + (min(k - n - 1, n - j + 1) * a) > t) break;
      r++;
    }
    res = max(res, r - j + 1);
  }
  cout << min(res, n) << '\n';
}
