#include <bits/stdc++.h>
using namespace std;
class C_ {};
template <typename T>
C_& operator<<(C_& __m, const T& __s) {
  if (!1) cerr << "\E[91m" << __s << "\E[0m";
  return __m;
}
C_ merr;
struct __s {
  __s() {
    if (1) {
      ios_base::Init i;
      cin.sync_with_stdio(0);
      cin.tie(0);
    }
  }
  ~__s() {
    merr << "Execution time: " << (double)clock() / CLOCKS_PER_SEC << " s.\n";
  }
} __S;
long long P[555555];
long long solve(int n, int a, int b, int t, const string& s) {
  long long ans = 0;
  long long sum = n + a * 1ll * (n - 1);
  for (int i = 0; i < n; i++) {
    if (s[i] == 'w') sum += b;
  }
  if (sum <= t) {
    return n;
  }
  if (s[0] == 'w' && b + 1 > t) {
    return 0;
  }
  t -= (1 + (s[0] == 'w') * b);
  P[n] = 0;
  for (int i = n - 1; i >= 0; i--) {
    P[i] = P[i + 1] + a + 1 + (s[i] == 'w') * b;
  }
  sum = 0;
  for (int i = 1; i < n; i++) {
    sum += a + 1 + (s[i] == 'w') * b;
    if (sum > t) break;
    ans = max(ans, (long long)i + 1);
    long long cur = sum + i * a;
    if (cur + P[n - 1] > t) continue;
    long long ll = 0, rr = n - 1;
    while (ll < rr) {
      long long mm = (ll + rr) / 2;
      if (P[mm] + cur > t) {
        ll = mm + 1;
      } else {
        rr = mm;
      }
    }
    ans = max(ans, (long long)i + 1 + n - ll);
  }
  return ans;
}
int main(void) {
  string s;
  int n, a, b, t;
  cin >> n >> a >> b >> t >> s;
  long long a1 = solve(n, a, b, t, s);
  int ll = 1, rr = n - 1;
  while (ll < rr) {
    swap(s[ll], s[rr]);
    ll++;
    rr--;
  }
  long long a2 = solve(n, a, b, t, s);
  cout << max(a1, a2) << '\n';
  return 0;
}
