#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int n, a, b, t, ans = -1;
int wat[500010], sum[500010];
string s;
int main() {
  cin >> n >> a >> b >> t >> s;
  for (int i = 0; i < n; i++) wat[i] = (s[i] == 'w' ? b : 0) + 1;
  if (wat[0] > t) {
    printf("0\n");
    return 0;
  }
  wat[n] = wat[0];
  for (int dec = 0; dec < 2; dec++) {
    sum[0] = 0;
    for (int i = 1; i <= n - 1; i++) sum[i] = sum[i - 1] + wat[i] + a;
    int come = 0, now = 0, back, lft;
    for (int i = n; i > 0; i--) {
      now++;
      come += wat[i];
      back = (n - i) * a;
      lft = t - come - back;
      ans = max(ans, now);
      if (lft < 0) break;
      int lb = 0, ub = n - i;
      while (lb <= ub) {
        int mid = (lb + ub) / 2;
        if (sum[mid] <= lft)
          lb = mid + 1;
        else
          ub = mid - 1;
      }
      ans = max(ans, now + ub);
      come += a;
    }
    reverse(wat, wat + n);
  }
  ans = min(ans, n);
  printf("%d\n", ans);
  return 0;
}
