#include <bits/stdc++.h>
using namespace std;
long long int back[1000000];
long long int forw[1000000];
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int a, b, c, i, j, k, n, m, t;
  cin >> n >> a >> b >> t;
  string str;
  cin >> str;
  long long int cost = 0;
  for (i = 0; i < str.length(); i++) {
    if (str[i] == 'w') cost += b;
    cost += 1;
    forw[i] = cost;
    cost += a;
  }
  long long int cur = 1;
  cost = 0;
  for (i = 0; i < str.length(); i++) {
    cur -= 1;
    if (cur == -1) cur = n - 1;
    if (str[cur] == 'w') cost += b;
    cost += 1;
    back[i] = cost;
    cost += a;
  }
  long long int ans = 0;
  long long int dir = 1;
  long long int tt = t;
  long long int other = n - 1;
  long long int other2 = n - 1;
  for (i = 0; i < n; i++) {
    if (ans >= n) {
      break;
    }
    if (tt >= forw[i]) {
      ans = max(ans, i + 1);
    }
    while (other > 0 && tt < forw[i] + back[other] + a * (i)) {
      other -= 1;
    }
    if (other > 0) {
      ans = max(ans, i + other + 1);
    }
  }
  cout << ans << endl;
  return 0;
}
