#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 123;
const long long INF = (long long)1e18 + 123;
const int inf = (int)1e9 + 123;
inline void boost() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
}
int n;
long long a, b, t;
char c[N - 2];
long long p[N], s[N];
bool check(int kol) {
  if (kol > n) return 0;
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    res = 0;
    int j = (n - (kol - i) + 1);
    res += p[i] + s[j];
    res += (i - 1) * a + (n - j + 1) * a;
    res += min((i - 1) * a, (n - j + 1) * a);
    if (res <= t) return 1;
  }
  return 0;
}
int main() {
  boost();
  cin >> n >> a >> b >> t;
  for (int i = 1; i <= n; i++) cin >> c[i];
  p[1] = 1;
  if (c[1] == 'w') p[1] += b;
  for (int i = 2; i <= n; i++) {
    p[i] = p[i - 1] + 1;
    if (c[i] == 'w') p[i] += b;
  }
  s[n] = 1;
  if (c[n] == 'w') s[n] += b;
  for (int i = n - 1; i >= 1; i--) {
    s[i] = s[i + 1] + 1;
    if (c[i] == 'w') s[i] += b;
  }
  int l = 0, r = N - 123;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (check(mid)) {
      l = mid;
    } else {
      r = mid - 1;
    }
  }
  if (check(r))
    cout << r;
  else
    cout << l;
  return 0;
}
