#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, T;
  cin >> n >> a >> b >> T;
  vector<int> cost(n), cost2(n);
  string s;
  cin >> s;
  long long t = 0;
  for (int x = 0; x < n; x++) {
    if (s[x] == 'w') t += b;
    t++;
    cost[x] = t;
  }
  long long t2 = 0;
  for (int x = n - 1; x >= 0; x--) {
    if (s[x] == 'w') t2 += b;
    t2++;
    cost2[x] = t2;
  }
  long long ans = 0;
  for (int x = 0; x < n; x++) {
    if (cost[x] + x * a > T) break;
    int lo = x + 1, hi = n - 1;
    while (lo <= hi) {
      int mid = (lo + hi) / 2;
      if (cost[x] + cost2[mid] + min(n - mid, x) * a * 2 + max(n - mid, x) * a >
          T) {
        lo = mid + 1;
      } else {
        hi = mid - 1;
      }
    }
    ans = max(ans, abs(n - lo) + x + 1LL);
  }
  cout << ans;
}
