#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 50;
const int maxm = 1e6 + 50;
const double eps = 1e-10;
const int max_index = 62;
const int inf = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
inline int read() {
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  int x = 0;
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x;
}
int a, b, n, t;
long long dp[maxn], cdp[maxn];
string s;
int main() {
  cin >> n >> a >> b >> t;
  cin >> s;
  dp[0] = -a;
  for (int i = 0; s[i]; i++) dp[i + 1] = dp[i] + a + (s[i] == 'w' ? b + 1 : 1);
  for (int i = 1; i <= n; i++)
    cdp[i] = cdp[i - 1] + (s[n - i] == 'w' ? b + 1 : 1) + a;
  int ans = 0;
  for (int i = 1; dp[i] <= t && i <= n; i++) {
    int res = t - dp[i] - a * (i - 1);
    if (res <= 0) {
      ans = max(ans, i);
      continue;
    }
    int id = lower_bound(cdp, cdp + n + 1, res) - cdp;
    if (cdp[id] > res) id--;
    id = max(0, id);
    ans = max(min(i + id, n), ans);
  }
  for (int i = 0; cdp[i] <= t && i <= n; i++) {
    int res = t - cdp[i] - i * a + (s[0] == 'w' ? b + 1 : 1);
    int id = upper_bound(dp + 1, dp + n + 1, res) - dp;
    if (res <= 0) ans = max(i + 1, ans);
    id = max(0, id);
    ans = max(min(i + id - 1, n), ans);
  }
  cout << ans << "\n";
  return 0;
}
