#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long oo = INT_MAX;
const long long MOD = 1e9 + 7;
const long long sz = 1e5 + 5;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long tc = 1;
  while (tc--) {
    long long n, a, b, T;
    cin >> n >> a >> b >> T;
    string s;
    cin >> s;
    for (auto& c : s) c = (c == 'w' ? '1' : '0');
    s = s + s;
    function<bool(long long)> check = [&](long long x) {
      long long l = n - (x - 1), r = n, end = n + x - 1, cost = 0;
      cost += (s[n] - '0') * b;
      cost += a * (x - 1);
      cost += x;
      for (long long i = l; i < n; ++i) cost += (s[i] - '0') * b;
      for (long long i = n + 1; i < r + 1; ++i) cost += (s[i] - '0') * b;
      while (l < n + 1) {
        long long lenL = n - l, lenR = r - n;
        if (lenL && lenR) cost += a * min(lenL, lenR);
        if (cost <= T) return true;
        if (lenL && lenR) cost -= a * min(lenL, lenR);
        cost -= b * (s[l] - '0');
        l++;
        r++;
        cost += b * (s[r] - '0');
      }
      return false;
    };
    long long l = 0, r = n + 1;
    while (l + 1 < r) {
      long long mid = l + (r - l) / 2;
      if (check(mid))
        l = mid;
      else
        r = mid;
    }
    cout << l << "\n";
  }
}
