#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, T;
  cin >> n >> a >> b >> T;
  string str;
  cin >> str;
  vector<long long> L, R;
  long long startCost = 1;
  if (str[0] == 'w') startCost = b + 1;
  L.push_back(0);
  R.push_back(0);
  long long cur = 0;
  for (int i = n - 1; i >= 1; i--) {
    cur += a;
    cur++;
    if (str[i % n] == 'w') cur += b;
    L.push_back(cur);
  }
  cur = 0;
  for (int i = 1; i < n; i++) {
    cur += a;
    cur++;
    if (str[i] == 'w') cur += b;
    R.push_back(cur);
  }
  int ans = 0;
  for (int i = 0; i <= n; i++) {
    long long c = startCost + L[i];
    if (c > T) break;
    ans = max(ans, i + 1);
    c += a * i;
    if (c > T) break;
    int t = T - c;
    int p = upper_bound(R.begin() + 1, R.end(), t) - R.begin();
    ans = max(ans, i + p);
    c += R[p - 1];
  }
  for (int i = 0; i <= n; i++) {
    long long c = startCost + R[i];
    if (c > T) break;
    ans = max(ans, i + 1);
    c += a * i;
    if (c > T) break;
    int t = T - c;
    int p = upper_bound(L.begin() + 1, L.end(), t) - L.begin();
    ans = max(ans, i + p);
    c += L[p - 1];
  }
  if (ans > n) ans = n;
  cout << ans << endl;
  return 0;
}
