#include <bits/stdc++.h>
using namespace std;
long long int dp[2100006];
long long int dprv[2100006];
long long int n;
long long int a, b;
long long int t;
long long int ans;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  long long int i, j;
  cin >> n >> a >> b >> t;
  cin >> s;
  for (i = 0; i < n; ++i) {
    if (i > 0) dp[i] += dp[i - 1] + a;
    dp[i] += (s[i] == 'w') * b;
    dp[i]++;
  }
  for (i = 0; i < n; ++i) {
    if (i > 0) dprv[i] += dprv[i - 1];
    dprv[i] += a;
    dprv[i] += (s[n - i - 1] == 'w') * b;
    dprv[i]++;
  }
  for (i = 0; i < n; ++i)
    if (dp[i] > t) break;
  i--;
  ans = i + 1;
  if (ans == 0 || ans == n) {
    cout << ans << endl;
    return 0;
  }
  j = 0;
  while (i >= 0 && dp[i] + a + dprv[0] > t) i--;
  while (i >= 0) {
    while (j < n && dp[i] + min((j + 1) * a, i * a) + dprv[j] <= t) j++;
    j--;
    if (i + j + 2 > ans) {
      ans = i + j + 2;
    }
    i--;
  }
  cout << ans << endl;
}
