#include <bits/stdc++.h>
using namespace std;
char _;
inline long long powmod(long long x, long long n, long long _mod) {
  long long res = 1;
  while (n) {
    if (n & 1) res = (res * x) % _mod;
    x = (x * x) % _mod;
    n >>= 1;
  }
  return res;
}
int n, aa, b, t;
string s;
long long sum[500005 * 2];
char a[500005 * 2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> aa >> b >> t;
  cin >> s;
  for (int i = 0; i < n; ++i) {
    a[i] = a[i + n] = s[i];
  }
  sum[n] = (a[n] == 'w') ? b + 1 : 1;
  for (int i = n + 1; i < 2 * n; ++i)
    sum[i] = ((a[i] == 'w') ? b + 1 : 1) + aa + sum[i - 1];
  for (int i = n - 1; i >= 0; --i)
    sum[i] = ((a[i] == 'w') ? b + 1 : 1) + aa + sum[i + 1];
  int r = 2 * n - 1;
  int ans = 0;
  for (int i = n; i >= 1; --i) {
    if (r <= n) break;
    while (1) {
      long long cost = sum[i] + sum[r] - sum[n];
      if (cost <= 1LL * t) {
        ans = max(ans, r - i + 1);
        break;
      }
      r--;
    }
  }
  ans = min(ans, n);
  cout << ans << '\n';
  return 0;
}
