#include <bits/stdc++.h>
using namespace std;
long long pos(long long t, long long n, long long fw[], long long bk[],
              long long lim, long long a) {
  long long i, j;
  long long pos = 0;
  for (i = 0; i < lim; i++) {
    if ((fw[i] + bk[(n - (lim - i) + 1) % n] - fw[0] + a * i) <= t ||
        t >= (fw[i] + bk[(n - (lim - i) + 1) % n] - fw[0] + a * (lim - i - 1)))
      pos = 1;
  }
  return pos;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  long long i, j, n, m, a, b, t;
  cin >> n >> a >> b >> t;
  string s;
  cin >> s;
  long long start = 0;
  long long end = n;
  long long fw[n];
  long long bk[n];
  if (s[0] == 'w')
    fw[0] = b + 1;
  else
    fw[0] = 1;
  for (i = 1; i < n; i++) {
    if (s[i] == 'w')
      fw[i] = fw[i - 1] + b + 1 + a;
    else
      fw[i] = fw[i - 1] + 1 + a;
  }
  bk[0] = fw[0];
  for (i = n - 1; i >= 1; i--) {
    if (s[i] == 'w')
      bk[i] = bk[(i + 1) % n] + b + 1 + a;
    else
      bk[i] = bk[(i + 1) % n] + 1 + a;
  }
  long long ans = 0;
  while (start <= end) {
    long long mid = (start + end) / 2;
    if (pos(t, n, fw, bk, mid, a) == 1) {
      start = mid + 1;
      ans = mid;
    } else {
      end = mid - 1;
    }
  }
  cout << ans;
  return 0;
}
