#include <bits/stdc++.h>
using namespace std;
long long n, a, b, T;
long long d[500005];
long long d1[500005];
long long d2[500005];
long long f(string s) {
  long long mx = 0;
  long long c = 0;
  memset((d), (0), sizeof(d));
  for (long long i = (0); i < (s.size()); ++i) {
    if (s[i] == 'w') {
      c += b;
      c++;
    } else {
      c++;
    }
    d[i] = c;
    c += a;
  }
  for (long long i = (0); i < (n); ++i) {
    if (d[i] <= T) {
      mx = max(mx, i + 1);
    }
  }
  memset((d1), (0), sizeof(d1));
  for (long long i = (0); i < (n); ++i) {
    d1[i] = d[i] + i * a;
  }
  string s1;
  s1 = s;
  reverse((s1).begin(), (s1).end());
  memset((d2), (0), sizeof(d2));
  c = 0;
  for (long long i = (0); i < (s1.size()); ++i) {
    c += a;
    if (s1[i] == 'w') {
      c += b;
      c++;
    } else {
      c++;
    }
    d2[i + 1] = c;
  }
  for (long long i = (0); i < (n); ++i) {
    if (d1[i] > T) continue;
    long long low = 0;
    long long high = n;
    while (low < high) {
      long long mid = (high + low + 1) >> 1;
      if (d1[i] + d2[mid] <= T) {
        low = mid;
      } else {
        high = mid - 1;
      }
    }
    mx = max(mx, i + 1 + low);
  }
  return min(mx, n);
}
int main() {
  cin >> n >> a >> b >> T;
  string s;
  cin >> s;
  long long c1 = f(s);
  string s1;
  for (long long i = (1); i < (s.size()); ++i) {
    s1 += s[i];
  }
  reverse((s1).begin(), (s1).end());
  string s2;
  s2 = s[0] + s1;
  long long c2 = f(s2);
  cout << max(c1, c2) << endl;
  return 0;
}
